﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="购物车：家具,家具网,买家具,网购家具,网上家具商城,网上买家具" />
<meta name="description" content="购物车：网上家具商城，在线销售田园家具，韩式家具，美式家具，儿童家具，现代家具，中式家具，欧式家具，板式家具，实木家具，沙发，软床，衣柜，餐桌。" />
<meta http-equiv="Expires" content="0">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<title>我的购物车Meilele 美乐乐家具网,网上家具商城:在线销售沙发 软床 实木床 餐桌 衣柜 韩式家具 美式家具 现代家具等</title>
<link rel="shortcut icon" href="http://image.meilele.com/favicon.ico" />
<link rel="stylesheet" href="css/mll.common.new.min.css" /><link href="css/flow2014.min.css" rel="stylesheet" type="text/css"/>
<style>.goods_item {border-top:1px dashed #eee}#JS_cart_body_1 tr:last-child {border-bottom:1px dashed #eee}</style>
<script src="js/common.min.js"></script>
<script>window.M = window.M || {};M.__IMG = 'http://image.meilele.com';if(window.$ && window.$.addToCart)M.addToCart = $.addToCart</script>
<script>if(/ipad_from=1/.test(location.search+location.hash+document.cookie)||window._ipad_from){window._ipad_from=true;window.__notAd=1;window._not_back_to_top=true;}window.getCookie=function(a){var e;if(document.cookie&&document.cookie!==""){var d=document.cookie.split(";");var f=d.length;for(var c=0;c<f;c++){var b=d[c].replace(/(^\s*)|(\s*$)/g,"");if(b.substring(0,a.length+1)==(a+"=")){e=decodeURIComponent(b.substring(a.length+1));break;}}}return e;};window._mllga=function(a){var g=(Math.random()+"").replace("0.","").substr(0,9)-0;var e=parseInt(new Date()/1000);var d=(Math.random()+"").replace("0.","").substr(0,9)-0;var f={utmwv:"5.6.0dc",utms:1,utmn:g,utmhn:location.host,utme:"8(COOKIE)9("+document.cookie.replace(/[()]/g,"")+")11(2)",utmcs:"UTF-8",utmdt:"notset",utmhid:e,utmp:location.host+location.pathname+location.search,utmht:+new Date(),utmac:"UA-48396005-1",utmcc:"__utma=165027242."+d+"."+e+"."+e+"."+e+".1;+__utmz=165027242."+e+".1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)"};for(var c in a){if(a[c]!==undefined){f[c]=a[c];}}var h=[];for(var c in f){h.push(c+"="+encodeURIComponent(f[c]));}var b=new Image();b.src="http://stats.g.doubleclick.net/__utm.gif?"+h.join("&");};(function(){window.onerror=function(e,d,b){window.onerror._root=window.onerror._root||{};var c=encodeURIComponent(e+"").replace(/\W/g,"");if(window.onerror._root[c]){return;}_mllga({utme:"8(COOKIE)9("+document.cookie.replace(/[()]/g,"")+")11(2)",utmdt:navigator.userAgent+"||"+e+"||"+d+"||"+b,utmac:"UA-48396005-1"});window.onerror._root[c]=true;};var a=function(){setTimeout(function(){window._gaq=window._gaq||[];window._ana=window._ana||[];if(_ana.push==Array.prototype.push){throw new Error("亲，_ana未初始！");}if(_gaq.push==Array.prototype.push){throw new Error("亲，_gaq未初始！");}},10000);};if(window.addEventListener){window.addEventListener("load",a,false);}else{if(window.attachEvent){window.attachEvent("onload",a);}}})();(function(){if(window.__notAd){return;}var c=document.createElement("script");c.type="text/javascript";c.async=true;var b=document.getElementsByTagName("script")[0];var a=new Date();c.src="http://image.meilele.com/js/recad.min.js?"+a.getFullYear()+a.getMonth()+a.getDate();b.parentNode.insertBefore(c,b);})();window._gaq=window._gaq||[];window.MLLgaq=window.MLLgaq||[];window._onReadyList=window._onReadyList||[];window._ana=window._ana||[];_ana.baseTime=_ana.baseTime;_gaq.push(["_setAccount","UA-10173353-1"]);_gaq.push(["_setDomainName","meilele.com"]);(function(i){if(getCookie("MLL_CID")){_gaq.push(["_setCustomVar",1,"CID",getCookie("MLL_CID"),2]);}var l=(location.search+"").replace("?","").split("&");var g={};for(var b=0,a=l.length;b<a;b++){var j=l[b].split("=");g[j[0]]=j[1];}var h=((location.hash+"").replace("#","")).split("#")[0].split("&");for(var b=0,a=h.length;b<a;b++){var j=h[b].split("=");h[j[0]]=j[1];}var f="";if(location.pathname.indexOf("/category-9999/")>=0&&g.keywords){f=g.keywords;}else{if(h.kw||g.kw){f=h.kw||g.kw;}}try{f=decodeURIComponent(f);}catch(c){}if(f&&window._ana){_ana.push(["trackEvent","siteSearch",f]);}})(window);(function(){if(window._IS_GET_TAG){return;}window._IS_GET_TAG=true;var b="utag";var a=18;if(/^\/article/i.test(location.pathname)){b="atag";}window._onReadyList=window._onReadyList||[];_onReadyList.push(function(){$.ajax({url:"/java_api/jmll/tag/getTag.do?u="+encodeURIComponent(location.pathname),cache:true,dataType:"json",success:function(o){var e=$.cookie(b)||"";var n=o||{};var h={},i=[],c=[],j=[];var m=function(k){k=k-0;k="00"+k.toString(36);return k.substr(k.length-2,2);};e=e.split("*");for(var g=0,d=e.length;g<d;g++){if(e[g]&&e[g].length==5){var l=e[g].substr(0,3);var f=parseInt(e[g].substr(3,2),36);h[l]={key:l,number:f};i.push(h[l]);}}for(var g in n){if(h[g]){h[g].number+=n[g];}else{h[g]={key:g,number:n[g]};}h[g].thisPage=true;c.push(h[g]);}c.sort(function(p,k){return k.number-p.number;});for(g=0,d=c.length;g<d;g++){j.push(c[g].key+m(c[g].number));}for(g=0,d=i.length;g<d;g++){if(!i[g].thisPage){j.push(i[g].key+m(i[g].number));}}if(j.length>a){j.length=a;}$.cookie(b,j.join("*"),{expires:90,domain:".meilele.com",path:"/"});window._SITETAGS={tags:h,thisPageTag:n};if(window._SITETAGSCALLBACK){_SITETAGSCALLBACK(_SITETAGS);}}});});})();
/*laidezhong:2015-01-27 10:47:52*//*laidezhong:2014-12-02 19:44:58*/</script><script src="js/jq.js"></script> 
<script>
$.__IMG = 'http://image.meilele.com' || 'http://image.meilele.com';
(function($){
	var lists = [
		[ 'checkPrize' , 'checkprize.min.js?0116g'],
		[ 'sendSms' , 'sendsms2.min.js?160307'],
		[ 'sendSmsGoods' , 'sendSmsGoods.min.js?060118'],
		[ 'codeSms' , 'codesms.min.js?1603031'], // 二维码短信
		[ 'orderQuery' , 'orderquery.min.js?0116g'],
		[ 'addToCart' , 'addtocart.min.js?201508188'],
		[ 'costDownTip' , 'costdowntip.min.js?160823'],
		[ 'searchKey' , 'searchkey.min.js?0915'],
		[ 'getComment' , 'getcomment.min.js?0801'],
		[ 'goodsComment' , 'goodscomment.min.js?0905'],
		[ 'quickBuy' , 'quickbuy.min.js?0812'],
		[ 'onlineVideo' , 'onlinevideo.min.js?0410'],
		// [ 'wholehouse' , 'mini_qwg.min.js?1205'],
		[ 'visitYBJ' , 'ybjvisit.min.js?0910'],
		[ 'mobileCaptcha','mobilecaptcha.min.js?060119'],
		[ 'shipRegion','ship_region.min.js?0715'],
		[ 'bonus','bonus.min.js?0520'],
		[ 'sendPrize','sendPrize.min.js?20160805'],
		// 发送购物车到手机
		[ 'cartSms','cartsms.min.js?0108']
	];
	var kk = lists.length;
	for(var k = 0 ; k < kk ; k++) {
		var key  = lists[k][0];
		var file = lists[k][1];
		$[ key ] = (function( key , file ){
			return function(){
				var params = arguments;
                
                if(key == 'codeSms') {
                    $.req( 'newCodeSms.min.js?160711' , function(){
                        $['newCodeSms'].apply( $ , params );
                    });
                } else {
                    $.req( file , function(){
                        $[key].apply( $ , params );
                    })
                }
                
			}
		})( key , file );
	}
	//特殊
	$.showLoginBox = function(callback,refresh,phone_num){
		if ($.cookie("meilele_login") == "1" && $.cookie("ECS[username]") ) {
			if (typeof callback == "function"){
				callback({
					"username": $.cookie("ECS[username]"),
					"email": $.cookie("ECS[email]")
				});
			}
			return;
		}
		$.req( 'showloginbox.min.js?0428' , function(){
			$.showLoginBox( callback,refresh,phone_num );
		});
	}
    
	if( window._ipad_from ){
		$.addToCart = function(mainGoodsId,goodsData){
			if( goodsData ){
				var tmpH = [];
				for(var k in goodsData){
					var data = goodsData[k];
					if( $.isNumeric(data) ){
						tmpH.push( k+':'+data );
					} else {
						var tmp = [];
						tmp.push(k);
						tmp.push(data.number || 1);
						tmpH.push( tmp.join(':') );
					}
				};
				tmpH = tmpH.join(',');
				window.open("/addToCart/"+tmpH);
			}
		}
		$.cookie('ipad_from',1,{domain:location.host});
	}
})(jQuery);
</script>



<script id="JS_map_city_data" type="text/html"></script>

<script>
    (function(){
        var that = this;
        if($.cookie('currentCity')) {
            return;
        }
        $.ajax({
            url:'http://api.map.baidu.com/location/ip?ak=R1CsBhbOHZyefZKArjicj741l7K36eyV',
            dataType: 'jsonp',
            success: function(json) {
                if(json && json.address) {
                    var addr = json.address.split('|')[2];
                    $.cookie('currentCity',addr,{
                        path: "/",
                        expires: 365,
                        domain: '.meilele.com'
                    });
                } else {
                    $.cookie('currentCity','北京');
                }
            },error: function() {
                $.cookie('currentCity','北京');
            }
        })
    })()
</script>


<script>window.M = window.M || {};if($.addToCart)M.addToCart = $.addToCart</script><script type="text/javascript">
if( window._ipad_from ){
    window.__notAd = 1;
    window._ipad_from = 1;
    $.wholehouse = function(){};
    window.mchat = window.mchat || {};
    mchat.config = {notShow:1};
    window._MLL_AD_INIT_FN = function(){}; 
    window._not_back_to_top = true;
}
function flowFormatPrice(price,notYen){
    price = price || 0;
    return (price<0?'- ':'')+(notYen?'':'<span class="yen">&yen;</span>')+(((price<0?(0-price):price)+'').replace('&yen;','').replace('￥','')-0).toFixed(2);
}

function isEmptyObject(obj){
    for(var k in obj){
        return false;
    }
    return true;
}
function insertOption(selectObj , options ){
    var selected = false;
    selectObj.options.length = 0;
    for(var k = 0 , kk = options.length ; k < kk ; k++){
        selectObj.options[k] = new Option(  options[k].innerHTML || '' , options[k].value || '' );
        if( options[k].selected ) selected = k;
        if( options[k].title ) selectObj.options[k].setAttribute( 'title' , options[k].title );
    }
    if(selected >= 0 && selectObj.options[selected])selectObj.options[selected].selected = true;
}
function $$(id){
    var o = document.getElementById((id+'').replace('#',''));
    return o ? o : {};
}
</script>
</head>
<body>
<script type="text/javascript">
if( window._ipad_from){
    document.body.className = 'ipad_root';
}
</script>





<script>
    window.M = window.M || {};M.__IMG = 'http://image.meilele.com';if(window.$ && window.$.addToCart)M.addToCart = $.addToCart
    
    if (navigator.userAgent.indexOf("iPad") != -1) {
        document.body.className = document.body.className + ' ipad_root';
    }
    //初始空函数，防止页面报错，勿删，函数真身在页脚。
    function _show_() {};
    function _hide_() {};
    var City = {
        init: function () {}
    }
    var M=M||{};M.getCookie=function(a){var e;if(document.cookie&&document.cookie!==""){var d=document.cookie.split(";");var f=d.length;for(var c=0;c<f;c++){var b=d[c].replace(/(^\s*)|(\s*$)/g,"");if(b.substring(0,a.length+1)==(a+"=")){e=decodeURIComponent(b.substring(a.length+1));break;}}}return e;};</script>

<!--如果不需要搜索和导航，在导入页面声明变量并且赋值 <大括号>assign var="xxx" value=1<大括号>-->


<div class="site-nav">
    <div class="w clearfix">
        <ul class="fl menu clearfix">
                        <li class="fl banner JS_login"><a target="_blank" href="/user/?act=login">请登录</a>
            </li>
            <li class="fl banner last JS_login"><a target="_blank" href="/user/?act=register">免费注册</a>
            </li>
        </ul>
        <ul class="fr menu clearfix">
            <li class="fl fore">
                <a class="drop-title" href="/user/?act=index" target="_blank">我的美乐乐<i class="drop-arrow" target="_blank"></i></a>
                <ul class="dropdown mll-self">
                    <li><a href="/user/?act=order_list" target="_blank">我的订单</a>
                    </li>
                    <li><a href="/user/?act=coin_log" target="_blank">我的金币</a>
                    </li>
                    <li><a href="/user/?act=bonus" target="_blank">我的红包</a>
                    </li>
                    <li><a href="/user/?act=collection_list" target="_blank">我的收藏</a>
                    </li>
                    <li><a href="/user/?act=comment_list" target="_blank">我要评价</a>
                    </li>
                    <li><a href="/user/?act=insured_apply" target="_blank">申请保价</a>
                    </li>
                </ul>
            </li>
                        
            <li class="fl fore">
                <a class="drop-title" href="/user/?act=index" target="_blank"><i class="i-scan"></i><span class="scan-word">关注美乐乐</span><i class="drop-arrow"></i></a>
                <ul class="dropdown two-dimension">
                    <li>
                        <a href="javascript:;" class="JS_header_gaerCode" target="_blank">
                            <img src="picture/1a6a7cb0136a4b309f2f647cfd91ff74.gif" width="132px" height="132px">
                        </a>
                        <span>扫码关注</span>
                        <img src="picture/1a6a7cb0136a4b309f2f647cfd91ff74.gif">
                    </li>
                </ul>
            </li>
            <li class="fl fore">
                <a class="drop-title" href="/article_cat-4/article-656.html" target="_blank">帮助中心<i class="drop-arrow" target="_blank"></i></a>
                <ul class="dropdown help-center">
                    <li><a href="/join_us-1.html" target="_blank">招商加盟</a>
                    </li>
                    <li><a href="/article_cat-6/article-101.html" target="_blank">购买流程</a>
                    </li>
                    <li><a href="javascript:;" onclick="window.mchat&&window.mchat.openui&& window.mchat.openui()" rel="nofollow">在线帮助</a>
                    </li>
                    <li><a href="/page_buniess_purchase.html" target="_blank">企业采购</a>
                    </li>
                </ul>
            </li>
            <li class="fl banner">
                <a href="javascript:;" onclick="shoucang()">收藏本站</a>
            </li>
            <li class="fl banner last">
                <span class="blank" style="width:222px;height:24px;z-index:2"></span>
                <div id="JS_head_scoll_phone_527" class="JS_head_scoll_phone_527_active_br">
                    <div style="height:26px;line-height:26px;width:213px;padding:0 5px;padding-left:7px;overflow:hidden;"><span style="color: #999;">全国热线：</span><span class="hotLine">400 0098666</span>
                    </div>
                </div>
            </li>
        </ul>
    </div>
</div>


<style>
    .page-header .ph-contenter .drcode-phone {top:-25px!important}
</style>

<div class="w fl_header clearfix">
    <a class="Left" id="JS_flow_home_link" href="/"><img class="fl_logo" src="picture/blank.gif" /></a>
    <div class="Right fl_step fl_step_cart"></div>
</div>


<script>
var _CHECKBOX_LIST = [];
</script>

<div class="flow_h2 w mt20 clearfix">
	<div class="Left text">我的购物车</div>
		<a class="Right cartSms" data-val="0" onclick="$.cartSms();return false;"><img src="picture/209d9cfebfb8293ab29b44c1cb18ae99.gif" width="22" height="22" style="background:none;" /> 免费发送购物车到手机</a>	</div>
<form action="/flow/?step=pre_checkout" method="post" id="JS_pre_check_form" target="_self">
<table class="w mt20 cart_table" id="JS_list_table_cb">
	<tbody>
		<tr>
			<th class="first"><input type="checkbox" class="JS_checkall_cb" checked="checked" onclick="selectAll(this);" title="全选"/></th>
			<th style="width:36px" class="lbn l">全选</th>
			<th style="" colspan="2">商品</th>
			<th style="width:8%">单价</th>
			<th style="width:15%">数量</th>
			<th style="width:8%">折扣</th>
			<th style="width:8%">金额</th>
			<th style="width:8%">优惠</th>
			<th style="width:10%">操作</th>
		</tr>
	</tbody>
			<tbody class="pt_box">
	<tr>
		<td><input data-key="1" id="JS_cart_shop_1" type="checkbox" checked="checked" onclick="selectAll(this);" data-index="1"/></td><td colspan="9" class="pt_name"><label for="JS_cart_shop_1">美乐乐自营</label></td>
	</tr>
		<tr class="JS_olympic none">
		<td colspan="3" class="olympic" style="text-align:center;">
			<span class="title">奥运盛典，4年就1回</span>
		</td>
		<td colspan="5" class="olympic ">
			<span class="cont JS_olympic_top1">商品金额已购满<i class="JS_h_goods_total_curentlevel_1"></i>元，可免费再选购<i class="JS_h_discount_could_1"></i>元</span>
			<span class="JS_olympic_top2">，</span>
			<span class="JS_olympic_top">若商品金额购满<i class="JS_h_goods_total_nextlevel_1"></i>元，可免费再选购<i class="JS_h_discount_nextlevel_1"></i>元商品。</span></td>
		<td colspan="2" class="olympic ">
			可加选：<i class="JS_h_discount_could_1"></i>元<br>
			已加选：<i class="JS_h_discount_real_1"></i>元
		</td>
	</tr>
		</tbody>
	<tbody id="JS_cart_body_1">
		<tr id="JS_cart_tr_24427651" class="goods_item JS_cart_act_0" data-act_id="0" data-rec_id="24427651" data-goods_id="25841" data-goods_num="1"  data-gift_kind="0" >
		<td>
						<input type="checkbox" data-key="1" data-type="0" checked="checked" id="JS_delete_checkbox_24427651" value="24427651" class="goods_select goods_select_0" name="rec_id[]" data-auction_id="0">
			<script>_CHECKBOX_LIST.push( 24427651 )</script>
					</td>
		<td colspan="2">
			<a href="/category-chuangtougui/goods-25841.html" target="_blank"><img class="img" src="picture/ykkxtd0+l8ct6mdtp0jutosxyzgqrayb484ndncywhpbnob8xyqrecrgfx+sfee6pfybn4eq8fzbhazvwexgig==.jpg" width="90" height="58" title="查看商品" /></a>
								</td>
		<td class="l goods_gift_24427651" style="line-height:1.5;padding-left: 10px;">
						<a href="/category-chuangtougui/goods-25841.html" target="_blank">时尚的可移动电脑桌 懒人电脑桌</a>
																				</td>
		<td class="yen">&yen;1000</td>
		<td class="m_goods_num" data-num="1">						<div class="clearfix number">
				<a href="javascript:;" onclick="changGoodsCount('24427651','25841',-1,false,false);return false;" class="Left sub" title="减少数量"></a><input onchange="this.value=(this.value+'').replace(/\D/g,'');changGoodsCount('24427651','25841',this.value,true,false);" id="JS_goods_number_24427651" class="Left num JS_cart_num_0" value="1" data-show_price="1000.00" data-shop_price="1000" data-rec_id="24427651" data-goods_id="25841" /><a class="Left add" href="javascript:;" onclick="changGoodsCount('24427651','25841',1,false,false);return false;" title="增加数量"></a><span class="Left unit">个</span>
			</div>
								</td>
		<td class="yen"><span name="goods_discount[24427651]" id="JS_goods_discount_24427651">&yen;<span class="JS_goods_discount">0</span></span></td>
		<td class="yen">
			<div class="goods_subtotal">&yen;<span id="JS_goods_subtotal_24427651" class="JS_goods_subtotal">1000</span></div>
					</td>
		<td></td>
		<td>
			<a class="orange" href="javascript:void(0);" data-rec_id="24427651" onclick="return flow_confirm(this,'确认删除？')">删除</a>
						<a class="orange" href="javascript:void(0);" onclick="collect_goods(25841,24427651);return false;">移入收藏夹</a>
								</td>
	</tr>
			</tbody>
			<tbody class="pt_box">
		<tr>
			<td colspan="10" class="pt_name"></td>
		</tr>
	</tbody>
	<tbody class="cart_extra">
		<tr>
			<th class="first rbn"><input type="checkbox" class="JS_checkall_cb" checked="checked" onclick="selectAll(this);" title="全选"/></th>
			<th class="lbn l">全选</th>
			<th colspan="2" class="lbn l">
				<a href="javascript:;" onClick="flow_confirm(this,'您确认要删除选中的商品吗?',deleteSelect);" class="delete_cart_goods" title="删除选中商品">删除选中商品</a></th>
			<th colspan="6" class="lbn r"><span class="selected-tip">已选<b class="selected-number" id="JS_selected_goods_number">1</b>件商品</span><span class="line">|</span><span class="f14"><b>商品总价</b>(不含运费)：<span class="red yen total_price f16">&yen;<span id="JS_after" class="f24">1000</span></span></span>
			</th>
		</tr>
	</tbody>
</table>
</form>
<!-- <div class="w cart_extra clearfix">
	<div class="Left">
		<input type="checkbox" class="JS_checkall_cb" checked="checked" onclick="selectAll(this);" title="全选"/>
		<a href="javascript:;" onClick="flow_confirm(this,'您确认要删除选中的商品吗?',deleteSelect);" class="delete_cart_goods" title="删除选中商品">删除选中商品</a>
	</div>
	<div class="Right r">
		<span class="f14 bt"><b>商品总价</b>(不含运费)：<span class="red yen total_price">&yen;<span id="JS_after">1000</span></span></span>
	</div>
</div> -->
<div class="cart_button w r mt20">
	<a href="/" class="back" title="继续购物"></a>&ensp;<a title="去结算" href="javascript:;" class="check" onclick="goPreCheck();return false;"></a></div>
<!-- <form id="JS_pre_check_form" target="_self" method="POST" action="/flow/?step=pre_checkout">
	<input id="JS_bonus_str_input" name="bonus_str" type="hidden" />
</form> -->
<script type="text/javascript">
window.google_tag_params = {ecomm_pagetype: 'cart'};
// console.log('This from common');
function changGoodsCount(id,goodsId,n,isChange,maxNumber){
/*修改购物车商品数量
@param String goods.rec_id
@param  n Number 增量
@param {Boolean} isChange 是否直接使用数量 
@param {Nmuber} 可允许最大数量
return undefined
*/
	if( window._changeGoodsNumberAjaxLocker )return;
	if(!id || !goodsId)return;
	var goodsCountObj = $("#JS_goods_number_"+id);
	if(!goodsCountObj.length)return;
	var goodsCount = parseInt(goodsCountObj.val() );
	if(!goodsCount)goodsCount = 1;
	var toCount = goodsCount + n;
	if( isChange )toCount=n;
	if( toCount < 1 ) toCount = 1;
	if( toCount > 9999) toCount = 9999;
	if( maxNumber > 0 && toCount > maxNumber ){
		$.alert("该商品数量不足！");
		goodsCountObj.val( maxNumber );
		return false;
	}
	var goods_list = [];

	var act_id = $('#JS_cart_tr_'+id).data('act_id');
	if(act_id>0){
		var act_list = $('.JS_cart_act_'+act_id);
		if(act_list.length > 1) {
			act_list.each(function(){
				var _this = $(this);
				var rec_id = _this.data('rec_id');
				goods_list.push( rec_id + ':' + toCount);
			});
		} else {
			goods_list.push( id + ':' + toCount);
		}
	} else {
		goods_list.push( id + ':' + toCount);
	}
    /*新增请求参数giftId*/
    var dom_giftId = ".mgift_id_"+id;
    var m_giftId = $(dom_giftId);
    var giftId ='';
    var obj_gift ={};
    if(dom_giftId.length){
        for(var i=0;i<m_giftId.length;i++){
            giftId += $(m_giftId[i]).attr("giftId")+",";
        }
        giftId = giftId.substring(0,giftId.length-1);
        obj_gift = {'giftId':giftId}
    }
    /* end */
	goodsCountObj.val( "..." );
	window._changeGoodsNumberAjaxLocker = M.ajax({
		url:"/add_cart/?step=changeCart&goods="+goods_list.join('|'),
		cache:false,
        data: obj_gift,
		dataType:"json",
		success:function(json){
			window._changeGoodsNumberAjaxLocker = null;
			if(json.error){
				if(json.msg){
					$.alert(json.msg);
					goodsCountObj.val( goodsCount );
					return;
				}else{
					this.error();
				}
			}
			else{
				if(act_id && act_list.length > 1){
					act_list.each(function(){
						var _this = $(this);

						var rec_id = _this.data('rec_id');
                        
						var _input = $('#JS_goods_number_'+rec_id);

						_input.val( toCount );

						var show =  _input.data('show_price') - 0;
						var shop =  _input.data('shop_price') - 0;

						$("#JS_goods_subtotal_"+rec_id).html( (show * toCount).toFixed(2) );
						$("#JS_goods_discount_"+rec_id).html( '&yen;' + ( (shop-show) * toCount).toFixed(2) );
					});
				} else {
					goodsCountObj.val( toCount );

					var show =  goodsCountObj.data('show_price') - 0;
					var shop =  goodsCountObj.data('shop_price') - 0;

					// var rec_id = _this.data('rec_id');

					$("#JS_goods_subtotal_"+id).html( (show * toCount).toFixed(2) );
					$("#JS_goods_discount_"+id).html( '&yen;' + ( (shop-show) * toCount ).toFixed(2) );
				}
                $(".mgift_id_" + id).remove();
                $('.zp').remove();
                _gift.init();
				_gift.setGiftData(json);
				refreshPrice(id);
			};

			$('#JS_list_table_cb tr.JS_gift_goods').remove();
            if(json.mainGoodsToGiftsResults[0].error == 0) {
                var t_data = json.mainGoodsToGiftsResults[0].result[id];
                if(t_data&&t_data.hasGifts ){
                    _gift.tr(t_data.gifts, id)
                    
                    var gift_kind_checknumer = $('.mgift_id_'+id).length;
                    
                    if(gift_kind_checknumer == 0) {
                        $("#JS_gift_tip_"+id).text('您还未选择！')
                    } else {
                        $("#JS_gift_tip_"+id).text('')
                    }
                    
                    
                }
            } else if(json.mainGoodsToGiftsResults[0].error == 1){
                if(json.mainGoodsToGiftsResults[0].msg){
                    alert(json.mainGoodsToGiftsResults[0].msg)
                }
            }
		},
		error:function(){
			$.alert("修改数量失败，请稍候再试");
			window._changeGoodsNumberAjaxLocker = null;
		}
	})
}

function collect_goods(goodsId,recId){
	var h = '';
	h += '<div class="mask_scj"></div>';
	h += '<div class="mask_scj_box">';
	    h += '<div class="cont">';
	        h += '<h3>收藏<a href="javascript:;" id="JS_del_scj">×</a></h3>';
	        h += '<div class="mid">';
	            h += '<p>移入收藏夹<br><span>移入后商品将不在购物车中展示</span></p>';
	            h += '<div class="btn"><span class="ok JS_ok" data-goodsId="'+goodsId+'" data-recId="'+recId+'">确定</span><span class="no JS_no">取消</span></div>';
	        h += '</div>';
	    h += '</div>';
	h += '</div>';
	$('body').append(h);
	$('.mask_scj').height( $('body').height() );
	
	//百度推广
	if(window.goSpread){
		var rtTag = {};
		var data = {};
		var goods = [];

		goods.push({p_id : goodsId || '',p_price : arguments[1] || ''});
		data = {ecom_favor : {prod : goods}};
		rtTag.data = data;
		window.goSpread(['_trackRTEvent',rtTag]);
	}
}

$('body').on('click','.JS_ok',function(){
	var me = $(this);
	$.ajax({
		url:'/add_cart/?step=insertGoodsToCollect',
		cache:false,
		dataType:'json',
		data:'goodsId=' + me.attr('data-goodsId') + '&rec_id='+ me.attr('data-recId'),
		success:function(result){
			$('.mask_scj').remove();
			$('.mask_scj_box').remove();
			if(result.error == 2){//需要登录
				$.showLoginBox(function(){
					collect_goods(me.attr('data-goodsId'),me.attr('data-recId'));
				})
			}else if(result.error == 0){//收藏成功
				$.ajax({
					url: '/add_cart/?step=dropGoods&ajax=1&goods='+me.attr('data-recId'),
					dataType: 'json',
					success: function(json){
						if(json && json.error == 0){
							location.href = '/flow/?step=cart';
						}else{
							$.alert( json.msg || '删除失败');
						}
					}
				});
				alert(result.msg);
				window.location.reload();
			}else if(result.error == 3){//已存在
				alert('该商品已经存在于您的收藏夹中。');
				window.location.reload();
			}else{//收藏失败
				$.alert(result.msg);
			}
		},
		error:function(){
			$.alert('发生网络错误，请稍候再试。');
		}
	});
}).on('click','.JS_no',function(){
	$('.mask_scj').remove();
	$('.mask_scj_box').remove();
}).on('click','#JS_del_scj',function(){
	$('.mask_scj').remove();
	$('.mask_scj_box').remove();
})
	$.addToCart.removeUI = function(){
		$.hideMask();
		$.closeLightBox( $.addToCart.lightBoxId , $.addToCart.afterhandle );
	}
/*
*勾选列表如有团购商品弹出并罗列4928需求
*/	
window.showTgMask = false; //弹出弹框的状态
function showTgGoods(unTg,t){
	$.showMask(999);
	var h = '';
	h += '<div class="tgLightBox">';
		h += '<div class="in">';
			h += '<a href="javascript:;" class="del" id="JS_del">×</a>';
			h += '<p class="error">您的购物车中有团购商品，请点击下方商品型号去团购频道购买，可享受团购价哦！</p>';
			h += '<table class="table1">';
				h += '<tbody><tr>';
					h += '<th colspan="2" style="width:252px">商品</th><th style="width:76px">售价</th><th>团购价</th>';
				h += '</tr></tbody></table>';
				h += '<div class="table"><table id="JS_tg_goods">'
																							h += '</table></div>';
			h += '<div class="btn">';

			//勾选的商品
			if( t.length > 0){
				h += '<a href="javascript:;" class="goTg" id="JS_goTg">去团购</a><a href="javascript:;" class="next" id="JS_next">下次吧</a>';
			}else{
				h += '<a href="javascript:;" class="goTg" id="JS_goTg">去团购</a>';
			}

			h += '</div>';
		h += '</div>';
	h += '</div>';
	$('body').append(h);

	//去掉没有勾选的团购商品
	if(unTg){
		for( var k = 0, kk = unTg.length; k < kk; k++ ){
			if( $("#JS_rec_id_"+unTg[k]) ){
				$("#JS_rec_id_"+unTg[k]).remove();
			}
		}
	}
}

$('body').on('click','#JS_del',function(){ //关闭弹框
	showTgMask = false;
	$(".tgLightBox").remove();
	$("#JS_mask").remove();
}).on('click','#JS_goTg',function(){//去团购吧
	window.location.href = $("#JS_tg_goods").find('a').eq(0).attr('href');
}).on('click','#JS_next',function(){//下次吧
	showTgMask = true;
	goPreCheck(1); //重新去结算
})

function goPreCheck(confirm){
	var t = [],unTg = [],checkedTg = [];
	//勾选的商品
	var goods_selected = $('#JS_list_table_cb td .goods_select:checked');
	for ( var i = 0,ii = goods_selected.length; i < ii; i++ ){
		var val = goods_selected.eq(i).val();
		if( goods_selected.eq(i).attr('data-type') == 0 ){//提交勾选的非团购商品
			t.push(val);
		}
		if( goods_selected.eq(i).attr('data-type') == 1 ){//被选中的团购商品data-typ为1
			checkedTg.push(goods_selected.eq(i));
		}
	}
	//没有勾选的商品
	var goodsUnselected = $('#JS_list_table_cb td .goods_select');
	for( var k = 0, kk = goodsUnselected.length; k < kk; k++ ){
		if( goodsUnselected.eq(k).prop('checked' ) == false && goodsUnselected.eq(k).attr('data-type') == 1 ){
			var val = goodsUnselected.eq(k).val();
			unTg.push(val);
		}
	}

	//如有勾选的团购商品罗列出来
	if( checkedTg.length > 0 && !showTgMask){
		showTgGoods(unTg,t);return;
	}
	if( showTgMask ){ //剔除被选中的团购商品
		var goods_selected = $('#JS_list_table_cb td .goods_select:checked'),newT = [];
		for(var i=0,ii=goods_selected.length;i<ii;i++){
			var val = goods_selected.eq(i).val();
			if( goods_selected.eq(i).attr('data-type') == 0 ){//提交勾选的非团购商品
				newT.push(val);
			}
		}
		t = newT;
	}
	$.ajax({
		url:'/core_api/PushMem/apicheckCartGoods/',
		type:'post',
		data:{rec_id:t},
		dataType:'json',
		success:function(json){
			showTgMask = false;
			$(".tgLightBox").remove();
			$("#JS_mask").remove();
			//去掉团购商品
			var goods_selected = $('#JS_list_table_cb td .goods_select:checked');
			for(var i=0,ii=goods_selected.length;i<ii;i++){
				var val = goods_selected.eq(i).val();
				if( goods_selected.eq(i).attr('data-type') == 1 ){
					goods_selected.eq(i).prop('checked',false);
				}
			}
			mask_show_goods(json);
		},error:function(){
			showTgMask = false;
			alert('数据连接失败，请重试！');
		}
	})
	function mask_show_goods(json){
		(function(){ //弹框样式
			var css = [];
				css.push( '.addToCart_LB{top:10%;_top:expression(eval(document.documentElement.scrollTop+50));}' );
				css.push( '.addToCart_LB .btns{border-top:0;}' );
				css.push( '.addToCart_LB .in{width:652px!important;}' );
				css.push( '.addToCart_LB .btns a{height:18px;line-height:18px;border-radius:0;background:#dcdcdc;background:linear-gradient(#fcfcfc,#f3f3f3) ;color:#666;border:1px solid #dcdcdc;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px;-khtml-border-radius:2px;font-family:"微软雅黑";font-size:14px;padding:7px 15px;}' );
				css.push( '.addToCart_LB .btns a:hover{background:#dcdcdc;background:linear-gradient(#fcfcfc,#f3f3f3) ;color:#666!important;}' )
				css.push( '.addToCart_LB .btns a.lightbox_btnsi_2{background:#d2033d;background:linear-gradient(#d9023f,#c9033b) ;border-color:#c10037;color:#fff;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px;-khtml-border-radius:2px;}' );
				css.push( '.addToCart_LB .btns a.lightbox_btnsi_2:hover{background:#d2033d;background:linear-gradient(#d9023f,#c9033b);color:#fff!important;}' );
				css.push( '.addToCart_LB .content .content_td{font-size:16px;font-family:"微软雅黑"}' );
				css.push( '.addToCart_LB .content .content_td p{font-size:12px;color:#999;font-family:"宋体"}' );
				$.insertStyle( css.join('') );
		})();

		var h = '';var a = 4;
		h += '<div class="clearfix title"><div class="Left"><i style="display:inline-block;"></i><span id="JS_addtocart_lb_title">提示</span></div><a href="javascript:;" class="Right" onclick="$.closeLightBox( \'{=id}\' ,  $.addToCart.removeUI );">&times;</a></div>';
		if(json.data){
			var is_Quota0 = [],is_Quota1 = [],is_Quota2 = [],is_Quota3 = [],is_Quota4 = [];
			for(var i=0,ii=json.data.length;i<ii;i++){
				if(json.data[i]['is_Quota'] == 0){
					is_Quota0.push(0);
				}else if(json.data[i]['is_Quota'] == 1){
					is_Quota1.push(1);
				}else if(json.data[i]['is_Quota'] == 2){
					is_Quota2.push(2);
				}else if(json.data[i]['is_Quota'] == 3){
					is_Quota3.push(3);
				}else if(json.data[i]['is_Quota'] == 4){
					is_Quota4.push(4);
				}
			}
			if((is_Quota2.length || is_Quota4.length || (is_Quota4.length && is_Quota2.length)) && !is_Quota0.length){
			//购物车中的商品全都为限购为0或下架停售的商品
				h += '<div class="content content_rate"><table style="margin: 0 auto;">'+
					'<tr>'+
						'<td class="icons_td"><span class="icons icons_warn"></span></td>'+
						'<td class="content_td">您选购的商品已下架或者停售</td>';
				h +=  '</tr></table></div>';
				var showBtn = {
					'确定':function(){
						$.addToCart.removeUI();
						location.reload() 
					}
				}
				$.lightBox(h, showBtn, null , null , null , true , 'MALERT MCONFIRM addToCart_LB');
				return false;
			}else if((is_Quota2.length && is_Quota0.length && !is_Quota1.length && !is_Quota3.length) || (is_Quota4.length && is_Quota0.length && !is_Quota1.length && !is_Quota3.length) || (is_Quota4.length && is_Quota2.length && is_Quota0.length && !is_Quota1.length && !is_Quota3.length)){
			//购物车有下架或者库存数量为0，还有可购买商品
				h += '<div class="content content_rate"><table style="margin: 0 auto;">'+
				'<tr>'+
					'<td class="icons_td"><span class="icons icons_warn"></span></td>'+
					'<td class="content_td">您购物车中有已下架或停售商品，下架或停售商品不会被提交结算</td>'+
				'</tr>'+
				'<tr><td></td><td class="content_td">&emsp;</td></tr>';
				for(var i=0,ii=json.data.length;i<ii;i++){
					if(json.data[i]['is_Quota'] == '2' || json.data[i]['is_Quota'] == '4'){
						h += '<tr><td></td><td class="content_td">'+json.data[i]['goods_name']+'&emsp;'+json.data[i]['goods_sn']+'</td></tr>';
					}
				}
				h +='</table></div>';
				var showBtn = {
					'确定':function(){
						setTimeout(function(){
							var checked_goods_xj = [];
							var goods_list_checked = $('#JS_list_table_cb td .goods_select:checked');
							for(var i=0,ii=json.data.length;i<ii;i++){
								if(json.data[i]['is_Quota'] == 2 || json.data[i]['is_Quota'] == 4){
									checked_goods_xj.push(json.data[i]['rec_id']);
								}
							}
							for(var i=0,ii=json.data.length;i<ii;i++){
								if(goods_list_checked.eq(i).val() == json.data[i]['rec_id']){
									if(json.data[i]['is_Quota'] == 2 || json.data[i]['is_Quota'] == 4){
										goods_list_checked.eq(i).prop('checked',false);
										goods_list_checked.eq(i).removeAttr('checked');
									}
								}
							}
							$('#JS_pre_check_form').submit();
						}, 0);
					}
				}
				$.lightBox(h, showBtn, null , null , null , true , 'MALERT MCONFIRM addToCart_LB');
				return false;
			}else if(is_Quota1.length || is_Quota3.length || is_Quota4.length){//购物车有库存数量不足的商品
				h += '<div class="content content_rate"><table style="margin: 0 auto;">'+
				'<tr>'+
					'<td class="icons_td"><span class="icons icons_warn"></span></td>'+
					'<td class="content_td">您购买的商品库存不足</td>'+
				'</tr>'+
				'<tr><td></td><td class="content_td">&emsp;</td></tr>';
				for(var i=0,ii=json.data.length;i<ii;i++){
					if(json.data[i]['is_Quota'] == '1' || json.data[i]['is_Quota'] == '3'){
						h += '<tr><td></td><td class="content_td">'+json.data[i]['goods_name']+'&emsp;'+json.data[i]['goods_sn']+' 库存数量'+json.data[i]['Quota_num']+'件</td></tr>';
					}else if(json.data[i]['is_Quota'] == '4' || json.data[i]['is_Quota'] == '2'){
						h += '<tr><td></td><td class="content_td">'+json.data[i]['goods_name']+'&emsp;'+json.data[i]['goods_sn']+'</td></tr>';
					}
				}
				h +='</table></div>';
				var showBtn = {
					'确定':function(){
						$.addToCart.removeUI();
						location.reload() 
					}
				}
				$.lightBox(h, showBtn, null , null , null , true , 'MALERT MCONFIRM addToCart_LB');
				return false;
			}else if((is_Quota2.length && is_Quota0.length && is_Quota1.length && is_Quota3.length) || (is_Quota2.length && is_Quota0.length && is_Quota1.length && is_Quota4.length) || (is_Quota2.length && is_Quota0.length && is_Quota1.length && is_Quota3.length && is_Quota4.length)){
			//购物车有下架或者库存数量为0，库存不足的商品，还有可购买商品
				h += '<div class="content content_rate"><table style="margin: 0 auto;">'+
				'<tr>'+
					'<td class="icons_td"><span class="icons icons_warn"></span></td>'+
					'<td class="content_td">您购买的商品库存不足</td>'+
				'</tr>'+
				'<tr><td></td><td class="content_td">&emsp;</td></tr>';
				for(var i=0,ii=json.data.length;i<ii;i++){
					if(json.data[i]['is_Quota'] == '2' || json.data[i]['is_Quota'] == '4'){
						h += '<tr><td></td><td class="content_td">'+json.data['goods_name']+'&emsp;'+json.data['goods_sn']+'</td></tr>';
					}else if(json.data[i]['is_Quota'] == '1' || json.data[i]['is_Quota'] == '3'){
						h += '<tr><td></td><td class="content_td">'+json.data[i]['goods_name']+'&emsp;'+json.data[i]['goods_sn']+' 库存数量'+json.data[i]['Quota_num']+'件</td></tr>';
					}
				}
				h +='</table></div>';
				var showBtn = {
					'确定':function(){
						$.addToCart.removeUI();
						location.reload() 
					}
				}
				$.lightBox(h, showBtn, null , null , null , true , 'MALERT MCONFIRM addToCart_LB');
				return false;
			}else if(is_Quota0.length && !is_Quota1.length && !is_Quota2.length && !is_Quota3.length && !is_Quota4.length){
				if(window.someGoodsisDeleted && confirm != 1 ){
					$.confirm('您购物车中有已下架或停售商品，下架或停售商品不会被提交结算。',{onOk: function(){
						goPreCheck(1);
					}});
					return false;
				}
			}
			check_goods_status();
		}else{
			if(window.someGoodsisDeleted && confirm != 1 ){
				$.confirm('您购物车中有已下架或停售商品，下架或停售商品不会被提交结算。',{onOk: function(){
					goPreCheck(1);
				}});
				return false;
			}
			check_goods_status();
		}
	}

	function check_goods_status(){
		if(!$.cookie('ECS[username]') || $.cookie('meilele_login') != 1){
			$.showLoginBox(goPreCheck);
			return false;
		}

		var goods_sub_list = $('#JS_list_table_cb td .goods_select:checked');
		if( goods_sub_list.length == 0 ) {
			$.alert('您还没有选择结算的商品！');
			return false;
		} else if( goods_sub_list.length > 1 && confirm != 2 ){
			var hasAuction;
			var index;
			goods_sub_list.each(function(i){
				if( $(this).data('auction_id') > 0 ){
					index = i;
					hasAuction = true;
					return false;
				}
			});

			if(hasAuction){
				$.confirm('您选择的商品中含有拍卖商品，将对该商品单独下单。',{onOk: function(){
					goods_sub_list.prop('checked', false).eq(index).prop('checked', true);
					goPreCheck(2);
				}});
				return false;
			}
		}

		/*if(bonusBox['_'] && bonusBox['_'].usedBonusList){
			$$('#JS_bonus_str_input').value = bonusBox['_'].getUsedBonusList().join(',');
		}else{
			$$('#JS_bonus_str_input').value = '';
		}*/
		if (!checkMoveToCollect()){
			setTimeout(function(){
				$('#JS_pre_check_form').submit();
			}, 0);
		}
	}
}
function selectAll(obj){
	// for(var k = 0,kk=_CHECKBOX_LIST.length;k<kk;k++){
	// 	M.$('#JS_delete_checkbox_'+_CHECKBOX_LIST[k]).checked = obj.checked;
	// }
	var checked = obj.checked;

	var index = $(obj).data('index');

	var selector = '#JS_list_table_cb input[type=checkbox]';

	if( index > 0 ) {
		selector = '#JS_cart_body_'+index+' input[type=checkbox]';
	}

	var input = $(selector).not(':disabled');

	input.each(function(){
		var _this = $(this);
		var _parent = _this.parentsUntil('tbody').last();
		var _act_id = _parent.data('act_id');
		if(_act_id > 0){
			$('.goods_select_'+_act_id).prop('checked',checked);
		}else{

			_this.prop('checked',checked);
		}
	});

	refreshPrice();
}
function deleteSelect(){
	var list = [];
	var goods_list = $('.delete_icon, .goods_select:checked');
	// for(var k = 0,kk=_CHECKBOX_LIST.length;k<kk;k++){
	// 	var  o = M.$('#JS_delete_checkbox_'+_CHECKBOX_LIST[k]);
	// 	if(o && o.checked ){
	// 		list.push( _CHECKBOX_LIST[k] );
	// 	}
	// }

	goods_list.each(function(i){
		var _this = $(this);
		var rec_id = _this.val() || _this.data('rec_id');

		list.push( rec_id );
	});

	if( list.length ){
		deleteCartGoods(list);
		// location.href = '/add_cart/?step=dropGoods&ajax=1&goods='+list.join('|');
	}else{
		$.alert('选中列表为空！');
	}
}

function deleteCartGoods(rec_id) {
	if(!rec_id) return false;
	$.ajax({
			url: '/add_cart/?step=dropGoods&ajax=1&goods='+rec_id.join('|'),
			dataType: 'json',
			success: function(json){
				if(json && json.error == 0){
					location.href = '/flow/?step=cart';
				}else{
					$.alert( json.msg || '删除失败');
				}
			}
		});
}
function flow_confirm(obj,msg , callback){
	var rec_id = [];
	var _this = $(obj);
	var recId = _this.data('rec_id');
	var act_id = $('#JS_cart_tr_'+recId).data('act_id');
	if(act_id > 0){
		var act_list = $('.JS_cart_act_'+act_id);
		act_list.each(function(){
			var self = $(this);
			rec_id.push( self.data('rec_id') );
		});
	} else {
		rec_id.push( _this.data('rec_id') );
	}
	$.confirm(msg,{
		onOk:callback||function(){
            deleteCartGift(recId);
			deleteCartGoods(rec_id);
		}
	});
	return false;
}

function deleteCartGift(recId) {
    var t = ".mgift_id_"+recId;
    if($(t).length>0)
        $(t).remove();
}   

//json跟字符串的相互转换
var changeString = {
    JSONstringify:function(Json){
        var result=this.toJSONString(Json);
        return result;
    },
    evalJSON : function(strJson) {
        return eval("(" + strJson + ")");
    },
    toJSONString : function(object) {
        var that = this;
        var type = typeof object;
        if ('object' == type) {
            if (Array == object.constructor)
                type = 'array';
            else if (RegExp == object.constructor)
                type = 'regexp';
            else
                type = 'object';
        }
        switch (type) {
            case 'undefined' :
            case 'unknown' :
                return;
                break;
            case 'function' :
            case 'boolean' :
            case 'regexp' :
                return object.toString();
                break;
            case 'number' :
                return isFinite(object) ? object.toString() : 'null';
                break;
            case 'string' :
                return '"' + object.replace(/(\\|\")/g, "\\$1").replace(/\n|\r|\t/g, function() {
                            var a = arguments[0];
                            return (a == '\n') ? '\\n' : (a == '\r') ? '\\r' : (a == '\t') ? '\\t' : ""
                        }) + '"';
                break;
            case 'object' :
                if (object === null)
                    return 'null';
                var results = [];
                for (var property in object) {
                    var value = that.toJSONString(object[property]);
                    if (value !== undefined)
                        results.push(that.toJSONString(property) + ':' + value);
                }
                return '{' + results.join(',') + '}';
                break;
            case 'array' :
                var results = [];
                for (var i = 0; i < object.length; i++) {
                    var value =  that.toJSONString(object[i]);
                    if (value !== undefined)
                        results.push(value);
                }
                return '[' + results.join(',') + ']';
                break;
        } 
    }
}

function olympicFn(){//Olympics活动
	var olympicData = [];
	var manageMode = '';
	var goods_sub_list = $('#JS_list_table_cb td .goods_select:checked');
	goods_sub_list.each(function(){
		var _this = $(this);
		if(_this.attr('data-key') == 1 ){
			manageMode = 1;
			olympicData.push({
				'goods_id':_this.closest('.goods_item').attr('data-goods_id'),
				'goods_number':_this.closest('.goods_item').find('input').eq(1).val()
			})
			
		}
	});
	var endOlympicData = changeString.JSONstringify( olympicData );
    $.ajax({
    	url:'/order_ajax/?step=olympic_activity',
    	type:'post',
    	data:{olympicGoods:endOlympicData} ,
    	dataTtype:'json',
    	success:function(json){
    		var json = changeString.evalJSON(json);
    		if( json.error == 0 ){
    			jQuery('.JS_olympic').removeClass('none');
    			if( json.msg.h_discount_top && json.msg.h_discount_top == 1 ){
    				$('.JS_olympic_top').hide();
    				$('.JS_olympic_top1').show();
    				$('.JS_olympic_top2').hide();
    			}else if( json.msg.h_goods_total_curentlevel == 0 ){
    				$('.JS_olympic_top1').hide();
    				$('.JS_olympic_top2').hide();
    				$('.JS_olympic_top').show();
    			}else{
    				$('.JS_olympic_top1').show();
    				$('.JS_olympic_top2').show();
    				$('.JS_olympic_top').show();
    			}
				$('.JS_h_discount_could_'+manageMode).text(json.msg.h_discount_could);
				$('.JS_h_goods_total_curentlevel_'+manageMode).text(json.msg.h_goods_total_curentlevel);
				$('.JS_h_discount_real_'+manageMode).text(json.msg.h_discount_real);
				$('.JS_h_goods_total_nextlevel_'+manageMode).text(json.msg.h_goods_total_nextlevel);
				$('.JS_h_add_price_'+manageMode).text(json.msg.h_add_price);
				$('.JS_h_discount_nextlevel_'+manageMode).text(json.msg.h_discount_nextlevel);
    		}else if( json.error == 1 ){
    			jQuery('.JS_olympic').addClass('none');
    		}
    	}
    })
	
}

olympicFn();

function refreshPrice(_rec){
	olympicFn();
	
	var goods_sub_list = $('#JS_list_table_cb td .goods_select:checked');
	var total = 0;
	var goods_total_num = 0;//已经选中的商品件数
	goods_sub_list.each(function(){
		var _this = $(this);
		var rec_id = _this.val();
		var dom = $('#JS_goods_subtotal_'+rec_id);
		total += Number(dom.text()) || 0;
	});
	
	$("#JS_after").html( total.toFixed(2) || 0 );
	//更新已选中的商品件数
	$('#JS_selected_goods_number').text(goods_total_num);
    
    //+,-执行每个商品及其赠品数量统计
    if(_rec){
        getGcount(_rec)
    }
    //总数量统计
    var target = $('#JS_list_table_cb td .goods_select:checked').closest('tr[data-goods_num]'),goods_total_num = 0;
    for(var i=0;i<target.length;i++){
        goods_total_num += +$(target[i]).attr('data-goods_num')
    }
    _gift.setNum(goods_total_num);
    $('#JS_selected_goods_number').text(_gift.getNum());
}

function getGcount(_rec) {
    var json = _gift.getGiftData(),total_num = 0,oTr = 'tr[data-rec_id="'+ _rec +'"]'
    if(json && json.mainGoodsToGiftsResults && json.mainGoodsToGiftsResults.length){
        if(json.mainGoodsToGiftsResults[0].error == 0 && json.mainGoodsToGiftsResults[0].result[_rec] && json.mainGoodsToGiftsResults[0].result[_rec].hasGifts){
            var gifts = json.mainGoodsToGiftsResults[0].result[_rec].gifts
            for(var i = 0,len = gifts.length;i < len;i ++){
                total_num += gifts[i].giftNumber || 0;
            }
        }
        var oInput = 'input[data-rec_id="'+ _rec +'"]'
        total_num += +$(oInput).val();
	} else if(json && json.result && json.result[_rec] && json.result[_rec].hasGifts){
        var gifts = json.result[_rec].gifts
		for(var i = 0,len = gifts.length;i < len;i ++){
			total_num += gifts[i].giftNumber || 0;
		}
        total_num += +json.result[_rec].goodsNum;
    }
    
    $(oTr).attr('data-goods_num',total_num)
}    
    
    
window.onload = function(){
	var ALL_LENGTH = $('#JS_list_table_cb input.goods_select').not(':disabled').length;
	$('#JS_list_table_cb td input:checkbox').click(function(){
		var _this = $(this);
		if( _this.is('.goods_select') ){
			var _parent = _this.parentsUntil('tbody').last();
			var _act_id = _parent.data('act_id');
			if(_act_id > 0){
				var checked = _this.prop('checked');
				$('.goods_select_'+_act_id).prop('checked',checked);
			}
			var _id = _parent.parent().attr('id');
			var _selector = '#' + _id.replace('body','shop');
			var _all_len = _parent.find('.goods_select').not(':disabled').length;
			var _len = _parent.find('.goods_select:checked').not(':disabled').length;


			if( _all_len == _len ){
				$(_selector).prop('checked',true);
			}else{
				$(_selector).prop('checked',false);
			}

		}

		var len = $('#JS_list_table_cb td input.goods_select:checked').not(':disabled').length;
		if( ALL_LENGTH == len ){
			$('.JS_checkall_cb').prop('checked',true);
		}else{
			$('.JS_checkall_cb').prop('checked',false);
		}

		// $('#JS_selected_num').text( len );
		refreshPrice();
	});

	$('.goods_item').click(function( event ){
		var _target = $(event.target);
		if( !_target.is('.goods_select') ) {
			var _checkbox = $(this).find('.goods_select').not(':disabled');
			if( ( _target.hasClass('add') || _target.hasClass('sub') ) && !_checkbox.prop('checked') ){
				_checkbox.click();
			}
		}
	});
}


function checkMoveToCollect(){
	var num = '1';
	var limit = 100;
	if(num <= limit){
		return false;
	}

	var overload = false;
	$.ajax({
		url : '/add_cart/?step=insertCollect',
		type : 'GET',
		dataType : 'JSON',
		cache : false,
		async : false,
		success : function(data){
			if(data && data.error == '0' && data.moveToCollect && data.moveToCollect.length){
				collectTip(data);
				overload = true;
			}else{
				overload = false;
			}
		}
	});
	return overload;
}

function favourAddToCart(goodsId){
	$.ajax({
		url:'/ajax_flow/?step=add_to_cart_new&nolist=1&goods_id='+goodsId+'&goods=' + goodsId + ':1' ,
		cache:false,
		dataType:'json',
		success:function(json){
			if(json && json.error == '0'){
				if(json.moveToCollect && json.moveToCollect.length){
					collectTip(json,'商品已成功放入购物车，购物车中的商品发生变动！');
				}else{
					collectTip(json,'商品已成功放入购物车！');
				}
			}
		},
		error:function(){
			$.alert('发生错误。请稍候再试。');
			setTimeout(function(){
				location.reload();
			}, 3000);
		}
	});
}

function collectTip(data,tip){
	$.showMask();
	tip = tip || '购物车中的商品发生变动！';
	var html = '<div class="clearfix title"><div class="Left"><i style="display:inline-block;"></i><span >提示</span></div><a href="javascript:;" class="Right" onclick="$.closeLightBox( \'{=id}\'  );location.reload();">&times;</a></div>';
	html +='<div class="content"><table style="margin: 0 auto;"><tr>'+'<td class="icons_td"><span class="icons icons_ok"></span></td>'+'<td class="content_td " ><b style="font-size:18px">' + tip + '</b></td>'+'</tr></table></div>';
	var h = [];
	var collect = data.moveToCollect;
	if(collect && collect.length){
		h.push('<div class="favour">');
		    h.push('<p class="itip"><b>重要提示：</b>购物车里有' + (collect.length || 0) + '件商品被移入收藏夹</p>');
		    h.push('<ul class="favour-list">');
		    	for(var i = 0,len = collect.length;i < len && i < 3;i ++){
		    		h.push('<li class="favour-item">' + '<a title="' + collect[i].goodsName + '" target="_blank" class="favour-link" href="' + collect[i].goodsLink + '">' + collect[i].goodsName +'</a>' + '</li>');
		    	}
			h.push('</ul>');
			h.push('<a target="_blank" href="/user/?act=collection_list" class="red favour-btn">查看收藏夹&gt;&gt;</a>');
		h.push('</div>');
	}
	$.lightBox(html + h.join(''), {
		'确定':function(){
			// $.hideMask();
			location.reload();
		}
	} , null , null , null , false , 'MALERT MCONFIRM importTip');
}

$(function(){
	checkMoveToCollect();
});
</script>














<div class="height15"></div>
<div class="footer-box">

    <div class="footer">
        <div class="footer-icon">
            <div class="w">
                <a href="/topic/article_diyipinpai.html#tab=o2o" target="_blank" title="网商+体验馆" rel="nofollow" class="icon-map"><p class="icon-bg i1"></p><p class="icon-title">网商+体验馆</p></a><a href="/topic/article_diyipinpai.html#tab=limited" target="_blank" title="7天限时达" rel="nofollow" class="icon-map"><p class="icon-bg i2"></p><p class="icon-title">7天限时达</p></a><a href="/topic/article_diyipinpai.html#tab=bso" target="_blank" title="100%正品" rel="nofollow" class="icon-map"><p class="icon-bg i3"></p><p class="icon-title">100%正品</p></a><a href="/topic/article_diyipinpai.html#tab=quality" target="_blank" title="双重质检" rel="nofollow" class="icon-map"><p class="icon-bg i4"></p><p class="icon-title">双重质检</p></a><a href="/topic/article_diyipinpai.html#tab=purchase" target="_blank" title="全球化采购" rel="nofollow" class="icon-map"><p class="icon-bg i5"></p><p class="icon-title">全球化采购</p></a><a href="/topic/article_diyipinpai.html#tab=returns" target="_blank" title="无理由退货" rel="nofollow" class="icon-map"><p class="icon-bg i6"></p><p class="icon-title">无理由退货</p></a><a href="/topic/article_diyipinpai.html#tab=postage" target="_blank" title="贵就赔" rel="nofollow" class="icon-map"><p class="icon-bg i7"></p><p class="icon-title">贵就赔</p></a><a href="/topic/article_diyipinpai.html#tab=mouth" target="_blank" title="万千口碑" rel="nofollow" class="icon-map"><p class="icon-bg i8"></p><p class="icon-title">万千口碑</p></a>
            </div>
        </div>
            </div>

    <div class="footer-copy">
        <div class="link-container">
                            <div class="w" aa="">
                    <div class="copy-index clearfix" style="padding-top:0">
                        <div class="fl">
                            <p>
                                <a href="http://www.meilele.com/list/" target="_blank" title="家具图片">家具图片</a> | <a href="/article/" target="_blank" title="家居资讯">家居资讯</a> | <a href="/baike/" target="_blank" title="生活百科">生活百科</a> | <a href="/article_cat-1/" target="_blank" title="家私导购">家私导购</a> | <a href="/brand/" target="_blank" title="品牌展厅">品牌展厅</a> | <a href="http://club.meilele.com" target="_blank" title="装修论坛">装修论坛</a> | <a href="http://www.melodyhome.com/" target="_blank" title="furniture store">furniture store</a> | <a href="/article_cat-4/article-656.html" target="_blank" title="客服中心" rel="nofollow">客服中心</a> | <a href="/sitesmap.html" target="_blank" title="网站地图">网站地图</a> | <a href="/links.html" target="_blank" title="友情链接" rel="nofollow">友情链接</a> | <a href="/keywords/" target="_blank" title="更多">更多</a>
                            </p>
                            <p>
                                <span class="yen">&copy; 2005-2016 </span><span id="JS_footer_copyright">美乐乐</span> 版权所有，并保留所有权利。<a href="http://www.miibeian.gov.cn/" target="_blank" class="gray" rel="nofollow">ICP备案证书号：粤ICP备08008334号</a>
                            </p>
                        </div>
                        <div class="fr credit">
                            <a target="_blank" href="https://search.szfw.org/cert/l/CX20141121005615005700"><span><i class="c1"></i>诚信网站示范企业</span></a>
                            <a target="_blank" href="https://ss.knet.cn/verifyseal.dll?sn=e12042051010018574308175&ct=df"><span><i class="c2"></i>可信网站信用评价</span></a>
                            <span><i class="c3"></i>经营网站备案信息</span>
                        </div>
                    </div>
                </div>
        </div>
    </div>
</div>



<script>
window._onReadyList = window._onReadyList || [];
window._onReadyList.push( function(){
	if( !/downAppIsShow\=1/.test( document.cookie ) && /ipad|ipod|iphone|android/i.test(navigator.userAgent)){
		$(window).on("load",function(){
			$.ajax({
				url:"/mll_api/api/appCenter?contentAdCode=zztcgg_yd&jumpAdCode=default_appjump&c=mobile_visit_www",
				dataType:"script"/*,
				error:function(){
					console.log(arguments)
				}*/
			})
		});
	}
} );
</script>
<script type="text/javascript">
if (!window.isOnlineIndex) {
	window.__QUIZ = false;
	_LOAD_SCRIPT_($.__IMG+'/themes/paipai/js/back_to_top.min.js?0120');
}
</script>

<script id="JS_city_data" type="text/html"></script>

<textarea id="JS_choose_city_source" style="display:none">
    <em class="i-c"></em>
    <div class="hideMap">
        <div class="showPanel clearfix" style="padding-bottom: 10px;">
            <div class="Left mycity">
                <div id="JS_current_city_box">
                    当前城市：<strong id="JS_city_current_city" style="color: #444;"></strong>
                    <a class="red" style="display:none" id="JS_set_default_city_header" href="javascript:;">[设为默认城市]</a>
                </div>
                <div id="JS_default_city_delete" style="display:none"></div>
            </div>
            <a class="Right near" id="JS_my_near_expr" target="_blank" href="/expr.html"><i class="i-coord"></i>附近的体验馆</a>
        </div>
        <div class="showPanel showPanel2 clearfix">
            <div class="hot_city" id="JS_header_city_hot"></div>
            <div class="mt10">
                <div id="JS_search_city_tip_header" class="search_city_tip" style="display:none;">抱歉，该城市暂无体验馆！</div>
                <input id="JS_search_city_input_header" class="search_city_input" value="输入城市名" /><input type="button" id="JS_search_city_submit_header" class="search_city_submit" value="搜索">
            </div>
            <div class="city_words mt10" id="JS_header_city_char"></div>
        </div>
        <div class="scrollBody">
            <div class="cityMap clearfix">
                <table id="JS_header_city_list" class="city_list"></table>
            </div>

            <div class="scrollBar"><span id="JS_header_city_bar"></span>
            </div>
        </div>
    </div>
</textarea>



<script>
    var City={};City.init=function(){if(City.ready&&City.currentCity==$("#DY_site_name").html().replace("站","")){return;}City.currentCity=$("#DY_site_name").html().replace("站","");City.handdler=$("JS_header_city_char");City.chars=$("#JS_header_city_char a");City.stage=$("#JS_header_city_list");City.lists=$("#JS_header_city_list tr");City.setDefaultDom=$("#JS_set_default_city_header");City.deleteDefaultCityDom=$("#JS_default_city_delete");City.nearDom=$("#JS_my_near_expr");City.currentBox=$("#JS_current_city_box");var c=City.stage.find("a");City.cityData={};for(var a=0,d=c.length;a<d;a++){var f=c[a];var g=f.getAttribute("data-region_id");var b=f.getAttribute("data-pinyin");var e=f.innerHTML;City.cityData[e]=City.cityData[b]=City.cityData[g]={regionId:g,pinyin:b,regionName:e};}c=null;City.defaultCity={};if($.cookie("default_rgn_id")){City.defaultCity=City.cityData[$.cookie("default_rgn_id")]||{};}$("#JS_city_current_city").html(City.currentCity);City.currentCityData=City.cityData[City.currentCity];City.refreshDefaultCityDom();City.inputDom=$("#JS_search_city_input_header");City.tip=$("#JS_search_city_tip_header");City.inputDom.keyup(function(h){City.tip.hide();if(h.keyCode==13){City.goSearch();}});City.inputDom.focus(function(){if(this.value=="输入城市名"){this.value="";}City.tip.hide();});$("#JS_search_city_submit_header").click(City.goSearch);City.bar=$("#JS_header_city_bar");City.barBox=$("#JS_header_city_bar_box");City.size=City.chars.length;City.allHeight=City.stage.height();City.rate=(City.allHeight-170)/(180-36);City.to=0;City.to2=0;City.nowH=0;City.mouseDown=false;City.selectByChar();City.scrollBar();City.scrollByWheel();City.ready=true;};City.refreshDefaultCityDom=function(){if(City.currentCity!="全国"&&City.currentCityData&&City.currentCityData.regionId!=City.defaultCity.regionId){City.setDefaultDom.show();City.setDefaultDom.attr("href","javascript:City.setDefaultCity('"+City.currentCityData.regionId+"')");}else{City.setDefaultDom.hide();City.nearDom.hide();}if(City.currentCity!="全国"&&City.currentCityData){City.nearDom.attr("href","/"+City.currentCityData.pinyin+"/area.html");City.nearDom.show();City.currentBox.show();}else{City.nearDom.hide();City.currentBox.hide();}if(City.defaultCity&&City.defaultCity.regionId){City.deleteDefaultCityDom.html('您默认的城市是：<a href="javascript:;" onclick="M.goExpr(City.defaultCity.pinyin,City.defaultCity.regionId,\'{$goExprUrlType}\',City.defaultCity.regionName);return false;" class="red">'+City.defaultCity.regionName+'</a> <a href="javascript:City.delDefaultCity();" class="red">[删除]</a>');City.deleteDefaultCityDom.show();}else{City.deleteDefaultCityDom.hide();}};City.setDefaultCity=function(a){if(a&&City.cityData[a]){City.defaultCity=City.cityData[a];$.cookie("default_rgn_id",City.cityData[a].regionId,{expires:365});City.refreshDefaultCityDom();}};City.delDefaultCity=function(){City.defaultCity={};$.cookie("default_rgn_id","",{expires:-1});City.refreshDefaultCityDom();};City.goSearch=function(){var b=(City.inputDom.val()+"").replace(/[\s\d]/g,"");var a=City.cityData[b];if(a){City.tip.hide();$.goExpr(a.pinyin,a.regionId,"{$goExprUrlType}",a.regionName);}else{City.tip.show();}};City.selectByChar=function(){var b=0;for(var a=0;a<City.size;a++){City.chars[a]._h=b;City.chars[a].onmouseover=function(){var c=this;window._cityTimer=setTimeout(function(){City.move(c._h);City.to2=City.to;},300);};City.chars[a].onmouseout=function(){if(window._cityTimer){clearTimeout(window._cityTimer);return;}};b+=City.lists.eq(a).height();}};City.move=function(b,a){if(b<0){b=0;}b=b>=(City.allHeight-170)?(City.allHeight-170):b;var c=parseInt(b/City.rate);if(a){City.stage.css("margin-top",(0-b)+"px");City.bar.css("margin-top",c+"px");}else{City.stage.stop(true,false).animate({marginTop:(0-b)+"px"});City.bar.stop(true,false).animate({marginTop:c+"px"});}City.to=c;City.nowH=b;};City.scrollBar=function(){City.bar.on("mousedown",function(a){a=a||window.event;City.mouseDown=true;City.nowHeight=a.pageY||a.clientY;a.returnValue=false;return false;});City.bar.on("dragstart",function(a){a=a||window.event;a.returnValue=false;});$("body").on("mouseup",function(a){a=a||window.event;City.mouseDown=false;City.to2=City.to;a.returnValue=false;return false;});City.barBox.on("mousemove",function(a){if(!City.mouseDown){return;}a=a||window.event;var b=a.pageY||a.clientY;City.move((b-City.nowHeight+City.to2)*City.rate,true);a.returnValue=false;return false;});};City.scrollByWheel=function(a){City.addScrollListener(City.barBox[0],function(c){c=c||window.event;var b;if(c.wheelDelta){b=(0-c.wheelDelta)/Math.abs(c.wheelDelta);}else{b=c.detail/Math.abs(c.detail);}City.move(City.nowH+b*50);City.to2=City.to;if(navigator.userAgent.toLowerCase().indexOf("msie")>=0){event.returnValue=false;}else{c.preventDefault();}});};City.addScrollListener=function(e,d){if(typeof e!="object"){return;}if(typeof d!="function"){return;}if(typeof arguments.callee.browser=="undefined"){var c=navigator.userAgent;var a={};a.opera=c.indexOf("Opera")>-1&&typeof window.opera=="object";a.khtml=(c.indexOf("KHTML")>-1||c.indexOf("AppleWebKit")>-1||c.indexOf("Konqueror")>-1)&&!a.opera;a.ie=c.indexOf("MSIE")>-1&&!a.opera;a.gecko=c.indexOf("Gecko")>-1&&!a.khtml;arguments.callee.browser=a;}if(e==window){e=document;}if(arguments.callee.browser.ie){e.attachEvent("onmousewheel",d);}else{e.addEventListener(arguments.callee.browser.gecko?"DOMMouseScroll":"mousewheel",d,false);}};City.exed=true;
/*leihao:2015-01-28 10:21:22*/</script>
<script>
    $('#JS_hide_city_menu_11').hover(
        function () {
            _show_(this, {
                source: 'JS_choose_city_source',
                target: 'JS_header_city_bar_box',
                data: 'JS_city_data',
                templateFunction: function (dom, json) {
                    dom = dom.jquery ? dom : $(dom);
                    if (json) {
                        var out = '';
                        var hot = '<a href="/" class="site_all Left" onclick="$.goExpr(\'index.html\',\'\',\'\',\'全国\');window._gaq.push([\'_trackEvent\',\'2016版首页\',\'成功切换城市\',\'click\']);return !1;"><strong>全国</strong></a>&nbsp;';
                        var inner = '';
                        var charList = '';

                        $.each(json.city_list, function (key, item) {
                            charList += '<a href="javascript:;">' + key + '</a>';
                            out += '<tr><th><div>' + key + '</div></th><td>';
                            $.each(item, function (index, shi) {
                                if (shi.v || shi.is_virtual) return; //屏蔽虚拟站点
                                var sp = shi.p || shi.pinyin,
                                    si = shi.i || shi.region_id,
                                    sn = shi.n || shi.region_name;
                                out += '<a href="/' + sp + '/" data-region_id="' + si + '" data-pinyin="' + sp + '" onclick="$.goExpr(\'' + sp + '\',\'' + si + '\',\'\',\'' + sn + '\');window._gaq.push([\'_trackEvent\',\'2016版首页\',\'成功切换城市\',\'click\']);return !1;">' + sn + '</a>';
                            });
                            out += '</td></tr>';
                        });

                        $.each(json.host_city_list, function (index, shi) {
                            var sp = shi.p || shi.pinyin,
                                si = shi.i || shi.region_id,
                                sn = shi.n || shi.region_name;
                            hot += '<a href="/' + sp + '/" data-region_id="' + si + '" data-pinyin="' + sp + '" onclick="$.goExpr(\'' + sp + '\',\'' + si + '\',\'\',\'' + sn + '\');window._gaq.push([\'_trackEvent\',\'2016版首页\',\'成功切换城市\',\'click\']);return !1;">' + sn + '</a>';
                        });

                        dom.find('#JS_header_city_hot').html(hot);
                        dom.find('#JS_header_city_char').html(charList);
                        dom.find('#JS_header_city_list').html(out);
                        return dom;
                    }
                }
            });
            City.init();
        },
        function () {
            _hide_(this);
        }
    );
</script>



<script>
    function shoucang(){window._gaq=window._gaq||[],_gaq.push(["_trackEvent","headerAddFavorite",location.href]);var t=window.location.href,e=document.title;try{window.external.addFavorite(t,e)}catch(a){try{window.sidebar.addPanel(e,t,"")}catch(t){alert("对不起，您的浏览器不支持此操作！n请您使用菜单栏或Ctrl+D收藏本站。")}}}function exprCallBackNum(json){if(json&&json.html_content){try{eval("json.html_content="+json.html_content)}catch(t){return void jQuery("#JS_head_scoll_phone_527").siblings("span.blank").remove()}if(!json)return;var o1=$("#JS_mll_head_menu_expr"),o3=$("#JS_Header_Home_Link"),o4=$("#JS_Header_Logo_link_home");json.html_content&&json.html_content.expr_count>0&&json.html_content.pinyin?(o1.attr("href","/"+json.html_content.pinyin+"/expr.html").html('体验馆<img src="'+$.__IMG+'/images/common/site/hot.gif">'),o3.attr("href","/"+json.html_content.pinyin+"/"),o4.attr("href","/"+json.html_content.pinyin+"/")):jQuery("#JS_head_scoll_phone_527").siblings("span.blank").remove();for(var len=exprCallBackNum.callFnArr.length,i=0;i<len;i++)exprCallBackNum.callFnArr[i]&&exprCallBackNum.callFnArr[i](json)}else jQuery("#JS_head_scoll_phone_527").siblings("span.blank").remove()}function Head_scroll_phone_527_fn(){if(!window._headPhoneScroll527Lock){var t=window._headPhoneScroll527Dom,e=window._headPhoneScroll527Length,a=window._headPhoneScroll527Now;t&&e&&jQuery(t).animate({marginTop:(a+1)*-26+"px"},300,"linear",function(){window._headPhoneScroll527Now++,window._headPhoneScroll527Now>=window._headPhoneScroll527Length/2&&(window._headPhoneScroll527Dom.css("margin-top","0px"),window._headPhoneScroll527Now=0)})}}function DY_cart_detail_nav_cb(t){Cart.goodsList=1,Cart.saleLimit=t.saleLimit||100;var e=t.goods_list.length;e>0&&(Cart.formatData(t)||{},Cart.info.goodsData=t.goods_list),Cart.update()}function _show_(t,e){if(t){if(e&&e.source&&e.target){var a="string"==typeof e.source?$("#"+e.source):$(e.source),n="string"==typeof e.target?$("#"+e.target):$(e.target),o="string"==typeof e.data?$("#"+e.data):$(e.data);if(a.length&&n.length&&!n.isDone){var r=$(a.val()||sourse.html());if(o.length&&"function"==typeof e.templateFunction){var i=o.val()||o.html();i=$.parseJSON(i),r=e.templateFunction(r,i),o.remove()}n.empty().append(r),a.remove(),"function"==typeof e.callback&&e.callback(),n.isDone=!0}}if($(t).addClass("hover"),e&&e.isLazyLoad&&t.isDone){for(var s=t.find("img"),l=0,c=s.length;l<c;l++){var u=s[l].getAttribute("data-src_index_menu");u&&(s[l].setAttribute("src",u),s[l].removeAttribute("data-src_index_menu"))}t.isDone=!0}}}function _hide_(t){if(t){var e=$(t);e.hasClass("hover")&&e.removeClass("hover")}}function shoucang(){window._gaq=window._gaq||[],_gaq.push(["_trackEvent","headerAddFavorite",location.href]);var t=window.location.href,e=document.title;try{window.external.addFavorite(t,e)}catch(a){try{window.sidebar.addPanel(e,t,"")}catch(t){alert("对不起，您的浏览器不支持此操作！n请您使用菜单栏或Ctrl+D收藏本站。")}}}function initInput(t,e){return t.placeholder?t.placeholder(e):null}function _INIT_HEAD_SEARCH(data){var json;try{json=eval(data.html_content)}catch(t){}if(json&&json.length){var url=location.pathname,wordIndex=-1,tmpFilter;window.__HEAD_SEARCH_WORDS_ARR=[],window.__HEAD_SEARCH_WORDS_OBJ={},/\/jiaju\//.test(url)?wordIndex=0:/\/jiancai\//.test(url)?wordIndex=1:/\/shipin\//.test(url)&&(wordIndex=2);for(var k=0,kk=json.length;k<kk;k++)tmpFilter=json[k].type.split(""),wordIndex!=-1&&1!=tmpFilter[wordIndex]||(__HEAD_SEARCH_WORDS_ARR.push(json[k]),__HEAD_SEARCH_WORDS_OBJ[json[k].text]=json[k]);var inpt=$("#JS_MLL_search_header_input")[0];__HEAD_SEARCH_WORDS_ARR.length&&inpt&&""==inpt.value&&(inpt.value=MLL_Header_search_words(),inpt.onfocus=function(){this.value="",this.onfocus=function(){}},inpt.onblur=function(){""==this.value&&(this.value=MLL_Header_search_words(),this.onfocus=function(){this.value="",this.onfocus=function(){}})})}}function MLL_Header_search_words(){var t=__HEAD_SEARCH_WORDS_ARR,e=Math.floor(Math.random()*t.length);return t[e].text}function MLL_header_search_submit(){var t=$("#JS_MLL_search_header_input")[0],e=($("#JS_search_form")[0],t.value+"");return e=$.trim(e||""),!!e&&(window.__HEAD_SEARCH_WORDS_OBJ&&__HEAD_SEARCH_WORDS_OBJ[e]?(location.href=__HEAD_SEARCH_WORDS_OBJ[e].href+(__HEAD_SEARCH_WORDS_OBJ[e].href.indexOf("#")>=0?"&":"#")+"kw="+encodeURIComponent(e),!1):(t.value=e,!0))}!function(t,e){function a(t,e){if(!t)return"";for(var a=0,n=[],o=0,r=t.length;o<r;o++){var i=t.charAt(o);if(i.charCodeAt(0)>255?a+=2:a++,!(a<=e))return n.join("");n.push(i)}return n.join("")}var n="1"==e.cookie("meilele_login")&&e.cookie("ECS[username]");if(n){e(".JS_login");e(".JS_login:eq(0)").after('<li class="fl banner"><a target="_blank" class="login-name" href="/user/" title="'+n+'">'+a(n,16)+'</a><a href="javascript:;" class="login-out" id="JS_login_out">[退出]</a></li>'),e(".JS_login").remove()}var o=new Image;(!/ECS_ID\=/.test(document.cookie)||/autoLogin\=/.test(document.cookie)&&!/meilele_login=1/.test(document.cookie))&&(o.src="/ecsid_maker/?_="+(new Date).getTime()),e("#JS_login_out").on("click",function(){jQuery.ajax({url:"/user/?act=logout",type:"get",cache:!1,dataType:"json",success:function(t){return 0==t.error?(window.location.reload(),!1):void jQuery.alert("注销失败，请重试！")},error:function(){jQuery.alert("网络异常，请重试！")}})})}(document,jQuery),exprCallBackNum.callFnArr=[],window._headPhoneScroll527Now=0;var car_number=0,Cart={};Cart.init=function(){Cart.handdler=$("#JS_cart,#JS_cart2"),Cart.Dom=Cart.handdler.find("#JS_cart_list,#JS_cart_list2"),Cart.number=Cart.handdler.find("#JS_cart_num,#JS_cart_num2"),Cart.countArea=Cart.handdler.find("#JS_count_area,#JS_count_area2"),Cart.countNum=Cart.handdler.find("#JS_cart_count,#JS_cart_count2"),Cart.sum=Cart.handdler.find("#JS_count_total,#JS_count_total2"),Cart._isIE=!-[1],Cart.info={goodsData:[],sum:0,goodsNumber:0,giftsNumber:0,kindsNumber:0},Cart.number.html($.cookie("cart_number")||0)},Cart.isLogin=function(){return"1"==$.cookie("meilele_login")||$.cookie("ECS[username]")},Cart.show=function(t){function e(t){Cart.goodsList||(Cart.Dom.html("")[0].className="cart-list",Cart.countArea.addClass("none"),Cart.getCartInfo(null,t))}Cart.isLogin()&&!Cart.moveToCollect.moved?Cart.moveToCollect(e):e(),$(t).addClass("hover"),Cart._isIE&&Cart.handdler.find(".cart-arrow").addClass("cart-arrow-ie")},Cart.getCartInfo=function(t,e){Cart.info={goodsData:[],sum:0,goodsNumber:0,giftsNumber:0,kindsNumber:0};var a={};e&&e.length&&(a.filterGoodsIds=e.join("!")),jQuery.ajax({url:"/mll_api/api/cart_info",dataType:"json",cache:!1,data:a,success:function(e){DY_cart_detail_nav_cb(e),t&&t(e)}})},Cart.setCartNum=function(t){jQuery.cookie("cart_number",t||0)},Cart.hide=function(){Cart.handdler.removeClass("hover"),Cart._isIE&&Cart.handdler.find(".cart-arrow").removeClass("cart-arrow-ie")},Cart.del=function(t,e){function a(t,e){for(var a=Cart.info,n=0;n<t.length;n++){var o=t[n],r=e[o].index,i=e[o].num||0,s=e[o].price||0,l=i*s,c=$(".JS_cart_list_gift_"+o);c.each(function(t){var e=parseInt(c.eq(t).attr("data-num"));a.giftsNumber-=e}),$(".JS_cart_list_index_"+r).remove(),c.remove(),a.goodsNumber-=i,a.kindsNumber--,a.sum-=l}Cart.update()}var n=t||window.event,o=n.target||n.srcElement;e&&(o=e);var r=$(o);if(!r.hasClass("Cart_del"))return!1;var i=r.attr("data-index"),s=r.attr("data-rec_id"),l=r.attr("data-num"),c=r.attr("data-goods_price"),u=r.attr("data-act_id"),d=[],_={};if(u>0){var m=Cart.Dom.find(".JS_cart_list_act_"+u);m.each(function(t,e){var a=$(this),n=a.data("rec_id"),o=a.data("index"),r=a.data("num");d.push(n),_[n]={index:o,num:r,price:0}})}else d.push(s),_[s]={index:i,num:l,price:c};!Cart.inDelAjax&&d.length>0&&(Cart.inDelAjax=!0,$.ajax({url:"/add_cart/?step=dropGoods&ajax=1&goods="+d.join("|"),type:"GET",dataType:"json",success:function(t){0==t.error?a(d,_):this.error()},error:function(){alert("删除失败，请稍后再试！")},complete:function(){Cart.inDelAjax=!1}}))},Cart.formatData=function(t){for(var e=Cart.info,a=t.goods_list,n=0,o=0,r=[],i=0,s=a.length;i<s;i++){var l=a[i].goods_thumb_1?a[i].goods_thumb_1:a[i].goods_thumb;r.push('<li class="JS_cart_list_index_'+i+'" class="'+("newgift"!=a[i].goods_activity_type?"":"JS_cart_list_gift_"+a[i].activity_par_id)+(a[i].price_activity_id>0?" JS_cart_list_act_"+a[i].price_activity_id:"")+'clearfix cart-item" data-num="'+a[i].goods_number+'" data-rec_id="'+a[i].rec_id+'" data-index="'+i+'">'),r.push('<a class="cart-img" href="'+a[i].url+'" target="_blank" title="'+a[i].goods_name+'"><img class="fl" src="picture/1a6a7cb0136a4b309f2f647cfd91ff74.gif'+l+'" alt="'+a[i].goods_name+'" width="86" height="57" ></a>'),r.push('<a target="_blank" class="cart-link" title="'+a[i].goods_name+'" href="'+a[i].url+'">'+a[i].goods_name+"</a>"),"newgift"!=a[i].goods_activity_type?(r.push('<p class="cart-cal clearfix"><a data-goods_id="'+a[i].goods_id+'" class="fr black Cart_del" href="javascript:void(0)" data-index="'+i+'" data-rec_id="'+a[i].rec_id+'" data-num="'+a[i].goods_number+'" data-goods_price="'+a[i].goods_price+'" data-act_id="'+(a[i].price_activity_id||0)+'">删除</a><span class="red" id="JS_danjia'+i+'">&yen;'+a[i].goods_price+'</span>×<span class="black">'+a[i].goods_number+"</span></p>"),e.goodsNumber+=a[i].goods_number-0,e.kindsNumber++,e.sum+=(a[i].goods_number||0)*(a[i].goods_price||0)):(r.push('<p class="cart-cal clearfix"><strong style="margin-left:12px"><span class="cl red">赠品</span>&times;'+a[i].goods_number+"</strong></p>"),o+=parseInt(a[i].goods_number)||0,e.giftsNumber+=a[i].goods_number-0),r.push("</li>"),n+=parseInt(a[i].goods_number)||0}return Cart.Dom.html(r.join("")),Cart.update(),e},Cart.goPreCheckOut=function(){jQuery.showLoginBox(function(){location.href="/flow/?step=pre_checkout&rel=header"})},Cart.moveToCollect=function(t){Cart.countArea.find(".cart-tip").remove(),jQuery.ajax({url:"/add_cart/?step=insertCollect",type:"GET",dataType:"JSON",cache:!1,success:function(e){if(e&&"0"==e.error&&e.moveToCollect&&e.moveToCollect.length){var a=e.moveToCollect,n=[],o=[];o.push('<div class="cart-tip"><span class="red"><b>提示：</b>购物车里有'+a.length+'件商品被移入收藏夹</span><p class="tip-content">');for(var r=0,i=a.length;r<i;r++)r<3&&o.push('<a target="_blank" class="tip-link" href="'+a[r].goodsLink+'">'+a[r].goodsName+"</a>"),n.push(a[r].goodsId);o.push('</p><a href="/user/?act=collection_list" target="_blank" class="red">查看收藏夹&gt;&gt;</a></div>'),Cart.countArea.append(o.join("")),t&&t(n)}else this.error();Cart.moveToCollect.moved=!0},error:function(){t&&t([]),Cart.moveToCollect.moved=!1}})},Cart.update=function(t){var t=t||Cart.info,e=Number(t.goodsNumber||0)+Number(t.giftsNumber||0);if(0==e)return Cart.setCartNum(0),Cart.number.html(0),Cart.Dom.html('<li class="nothing"><b class="common-bg nothing-icon"></b>&nbsp;购物车中还没有商品，赶紧选购吧！</li>'),Cart.countArea.addClass("none"),void Cart.Dom.removeClass("cart-full");Cart.number.html(e),Cart.countNum.html(e),Cart.sum.html("&yen;"+Number(t.sum||0).toFixed(2)),Cart.Dom.addClass("cart-full"),Cart.countArea.removeClass("none"),Cart.setCartNum(e);var a=Cart.Dom.find(".cart-item").length;Cart.Dom.addClass("cart-full"+(a>2?3:a)),0==a&&(Cart.Dom[0].className="cart-list")},function(t){function e(e){var a=t(this),n=null,o=[],r=null,i=null,s=null,l=t.extend({rowSelector:"> li",submenuSelector:"*",submenuDirection:"right",tolerance:75,enter:t.noop,exit:t.noop,activate:t.noop,deactivate:t.noop,exitMenu:t.noop,firstDelay:0},e),c=3,u=300,d=function(t){o.push({x:t.pageX,y:t.pageY}),o.length>c&&o.shift()},_=function(){clearTimeout(s),i&&clearTimeout(i),l.exitMenu(this)&&n&&l.deactivate(n),n=null},m=function(){!n&&clearTimeout(s)},h=function(t){i&&clearTimeout(i),l.enter(this),v(this)},f=function(t){l.exit(this)},p=function(t){g(this),t.stopPropagation()},g=function(t){function e(t){l.activate(t),n=t}clearTimeout(s),n&&l.deactivate(n),!n&&l.firstDelay?s=setTimeout(function(){e(t)},l.firstDelay):e(t)},v=function(t){var e=C();e?i=setTimeout(function(){v(t)},e):g(t)},C=function(){function e(t,e){return(e.y-t.y)/(e.x-t.x)}if(!n||!t(n).is(l.submenuSelector))return 0;var i=a.offset(),s={x:i.left,y:i.top-l.tolerance},c={x:i.left+a.outerWidth(),y:s.y},d={x:i.left,y:i.top+a.outerHeight()+l.tolerance},_={x:i.left+a.outerWidth(),y:d.y},m=o[o.length-1],h=o[0];if(!m)return 0;if(h||(h=m),h.x<i.left||h.x>_.x||h.y<i.top||h.y>_.y)return 0;if(r&&m.x==r.x&&m.y==r.y)return 0;var f=c,p=_;"left"==l.submenuDirection?(f=d,p=s):"below"==l.submenuDirection?(f=_,p=d):"above"==l.submenuDirection&&(f=s,p=c);var g=e(m,f),v=e(m,p),C=e(h,f),w=e(h,p);return g<C&&v>w?(r=m,u):(r=null,0)};a.on("mouseleave",_).on("enter",m).find(l.rowSelector).on("mouseenter",h).on("mouseleave",f).on("click",p),t(document).mousemove(d)}jQuery.fn.menu=function(t){return this.each(function(){e.call(this,t)}),this}}(jQuery),function(t){t&&(t.fn.placeholder=function(e){function a(t,e){t.val()==r.txt&&t.val("").addClass(r.focusClsName&&r.focusClsName.join?r.focusClsName.join(" "):""),e&&e()}function n(t,e){""==t.val()?t.val(r.txt).removeClass(r.focusClsName&&r.focusClsName.join?r.focusClsName.join(" "):""):e&&e()}var o={txt:"",cssStr:"",focusClsName:void 0,focusFun:void 0,blurFun:void 0,clsName:void 0},r=t.extend({},o,e||{}),i=t(this),s=i.prop("type");if(s=s?"password"!=s&&"text"!=s?"text":s:"text","text"==s)i.val(r.txt),i.focus(function(t){a(i,r.focusFun)}).blur(function(){n(i,r.blurFun)});else{var l;l=i.next("input").length?i.next("input").eq(0):t("<input />").addClass(r.clsName&&r.clsName.join?r.clsName.join(" "):"");var c={show:{display:""},hide:{display:"none"}};l.focus(function(t){l.css(c.hide),i.css(c.show).focus(),r.focusFun&&r.focusFun()}).val(r.txt),i.css(c.hide).after(l).blur(function(){i.val()?void 0:l.css(c.show)&&i.css(c.hide),r.blurFun&&r.blurFun()})}return i.setTxt=function(t){return i.next("input").length?i.next("input").eq(0).val(t):i.val()==r.txt&&i.val(t),r.txt=t,i},i.getText=function(){return r.txt},i.setParam=function(t,e){return r[t]=e,i},i.getParam=function(t){return r[t]},i})}($);
/*mazengliang:2016-08-15 22:01:01*/</script>
<script>
    window._onReadyList = window._onReadyList || [];
    window._QUIZ = 'http://www.meilele.com/diaocha63.html';
    window.DOM = {}
    var google_tag_params = {
        pagetype: 'home'
    };

    function toggleExprName(d) {
        d = d || document;
        var m = d.getElementById('JS_n_head_menu_expr');
        var py = $.cookie('region_pinyin');
        var is_vertual = $.cookie('region_virtual');
        if (py) {
            var homeLink = d.getElementById('JS_Header_Home_Link'),
                logoLink = d.getElementById('JS_Header_Logo_link_home');
            homeLink && homeLink.setAttribute('href', '/' + py + '/');
            logoLink && logoLink.setAttribute('href', '/' + py + '/');
        }
        if (py && m && is_vertual != 1) {
            m.setAttribute('href', '/' + py + '/expr.html');
            m.innerHTML = '体验馆<img src="' + M.__IMG + '/images/hot2015.gif" style="position:absolute;background:none;right:0px;top:-5px;" />';
        } else if (py && m && is_vertual == 1) {
            m.setAttribute('href', '/topic/2014_zsjm01.html?from=nav');
            m.innerHTML = '招商加盟<img src="' + M.__IMG + '/images/new2015.gif" style="position:absolute;background:none;right:0px;top:-5px;" />';
        }
    }
    window._onReadyList = window._onReadyList || [];
    _onReadyList.push(toggleExprName, function () {
        var domain = $.hash().domainFrom;
        if (!/meilele\.com/.test(location.host) || domain) {
            var d = document.getElementById('JS_Header_Logo_link_home');
            d.setAttribute('href', 'http://' + (domain || location.host));
            d.setAttribute('target', '_top');
        }
    });

    $(document).ready(function () {
        //初始化购物车
        jQuery('#JS_cart,#JS_cart2').hover(function(){
                Cart.show(this)
           },function(){
                Cart.hide(this)
           });
        Cart.init();

        //初始化搜索
        $('#JS_MLL_search_header_input').click(function () {
            jQuery.searchKey('JS_MLL_search_header_input', 'JS_search_suggest');
            $('#JS_MLL_search_header_input').unbind('click');
            $(this).addClass('search-input-focus');
            return false;
        });

        //初始化三级菜单
        $('.menu-panel').on({
            'mouseenter': function () {
                $('#JS_mll_menu_map').show();
            },
            'mouseleave': function () {
                $('#JS_mll_menu_map').hide();
            }
        })
        var globalMenu = $('#JS_mll_menu_map');
        globalMenu.menu({
            activate: function (item) {
                var _this = $(item);
                if (!_this.data('imgLoaded')) {
                    var img = _this.find('.sub img');
                    img.prop('src', img.attr('menu-lazy-src')).removeAttr('menu-lazy-src');
                    _this.data('imgLoaded', 1);
                }
                _this.addClass('hover').find('.sub').stop().animate({
                    'padding-left': '10px',
                    'opacity': '1'
                }, 200);

                var ie6 = !-[1, ] && !window.XMLHttpRequest;
                if (ie6) {
                    if (_this.hasClass('large-class')) {
                        globalMenu.css('width', '975px');
                    } else {
                        globalMenu.css('width', '845px');
                    }
                }
            },
            deactivate: function (item) {
                var _this = $(item);
                _this.removeClass('hover').find('.sub').stop().animate({
                    'padding-left': 0,
                    'opacity': '.8'
                }, 200);
            },
            rowSelector: 'li.map-item',
            exitMenu: function (menu) {
                var menu = $(menu);
                var cur = menu.find('.hover');
                var curSub = cur.find('.sub');
                cur.find('em').stop().animate({
                    'padding-left': 0,
                    'opacity': 0
                }, 200);
                cur.removeClass('hover');

                var ie6 = !-[1, ] && !window.XMLHttpRequest;
                if (ie6) {
                    globalMenu.css('width', '200px');
                }
            },
            firstDelay: 100
        });

        //顶部导航
        $('.site-nav .drop-title').parent().on({
            'mouseenter': function () {
                jQuery(this).addClass('hover')
            },
            'mouseleave': function () {
                jQuery(this).removeClass('hover')
            }
        });

        if ($.saleNumUpdate) {
            $.saleNumUpdate([{ //更新价格
                'selector': '.JS_async_price',
                'type': 'price',
                'param': 'id',
                'key': 'show_price',
                'isInt': true
            }]);
        }
    })
</script>


<script>
    ;(function () {
        var linkcity = $('#link_city');
        var linkfri = $('#link_fri');
        var moreCityBtn = $('#more_city');
        var moreFriBtn = $('#more_fri');

        if (linkcity.find('.link-content').height() > 20) {
            moreCityBtn.css('display', 'block');
            moreCityBtn.click(function () {
                moreCityBtn.hide();
                linkcity.css('height', 'auto');
            })
        }
        if (linkfri.find('.link-content').height() > 20) {
            moreFriBtn.css('display', 'block');
            moreFriBtn.click(function () {
                moreFriBtn.hide();
                linkfri.css('height', 'auto');
            })
        }
    })()
    ;(function () { //清除电信广告
        function checkIframe(nLen) {
            if (nLen > 10) return; //最多检测10 秒钟
            var bRemove = false;
            var oIframes = document.getElementsByTagName('iframe');
            var oIframe = null;
            if (oIframes == null || oIframes.length == 0) {
                window.setTimeout(function () {
                    checkIframe(nLen + 1)
                }, 1000);
                return;
            }
            var nLength = oIframes.length;
            for (var i = 0; i < nLength; i++) {
                oIframe = oIframes[i];
                var strSRC = oIframe.src;
                if (/72link/.test(strSRC)) {
                    setTimeout(function () {
                        location.reload();
                    }, 1000)
                    throw new Error('发现电信广告');
                }

            }
            if (!bRemove) window.setTimeout(function () {
                checkIframe(nLen + 1)
            }, 1000);
        }
        window.setTimeout(function () {
            checkIframe(0)
        }, 100);
    })();
    //JS域名验证
    // (function () {
    //     function checkEnd(endStr) {
    //         var url = location.host,
    //             flag;
    //         for (var i = 0; i < endStr.length; i++) {
    //             var d = url.length - endStr[i].length;
    //             if (d >= 0 && url.lastIndexOf(endStr[i]) == d)
    //                 return true;
    //         }
    //         return false
    //     }
    //     var urlList = ['\x2e\x6d\x65\x69\x6c\x65\x6c\x65\x2e\x63\x6f\x6d',
    //                    '\x2e\x68\x65\x6e\x67\x79\x65\x72\x2e\x63\x6f\x6d'];
    //     if (!checkEnd(urlList)) {
    //         location.href = '\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x6d\x65\x69\x6c\x65\x6c\x65\x2e\x63\x6f\x6d'
    //     }
    // })()
</script><div id="static_dynamic" name="static_dynamic" page_sn="flow" rgn_id="" debug=""></div>
<script type="text/javascript">window.static_dynamic && static_dynamic();</script><script type="text/javascript">
var mchat = mchat || {};
mchat.not2 = true;

//添加顶部"帮助中心"hover
$('#JS_common_head_help').hover(function(){
    $(this).addClass('hover');
},function(){
    $(this).removeClass('hover');
});

</script>
<div id="INIT_Fchat2" class="" style="display: none;width: 58px;height: 127px;right: 5px;top: 190px;_top: expression(eval(document.documentElement.scrollTop+190));background: url(images/1401178094439.png) 0 0;_background: url(http://image.meilele.com/images/201405/140117892382.gif) 0 0;cursor: pointer;font-size: 12px;z-index: 1500;position: fixed;_position: absolute;overflow: hidden;"><div class="FC_btns FC_number" style="margin-left:24px;margin-top:-1px;" id="JS_FC_number2"></div></div>
<script type="text/javascript">
(function(){
	window.mchat = window.mchat || {};

	
	var d = document.getElementById('INIT_Fchat2');
	if( (d && mchat.config) || window._ipad_from ){
		d.style.display = 'none';
	}
	var date = new Date();
	d.onclick = function(){
		if( mchat.show ){
			mchat.show();
		}else{
			if (window.isOnlineIndex) {
				$.ajax({
					url:'http://image.meilele.com/js/mll/chatFloat_new.min.js?'+date.getFullYear()+date.getMonth()+date.getDate(),
					cache:true,
					dataType:'script'
				});
			} else {
				$.ajax({
					url:'http://image.meilele.com/js/mll/chatFloat.min.js?'+date.getFullYear()+date.getMonth()+date.getDate(),
					cache:true,
					dataType:'script'
				});
			}
		}
	}
	setTimeout(function(){
		if ( !mchat.config  || !mchat.config.background_main ) {
			$('#INIT_Fchat2').trigger('click');
		}
	},1500);
})();
</script><script type="text/javascript">
(function(){
    var pinyin = $.cookie('region_pinyin');
    if(pinyin && /[a-z]+/ig.test(pinyin)){
        $('#JS_flow_home_link').attr('href','/' + pinyin + '/');
    }
})();
;(function(window){
    //百度推广
    var rtTag = {};
    var data = {};
    var goods = [];
    /**/
        /**/
        goods.push({p_id : '25841',p_price:'1000',p_num:'1'});
        /**/
    /**/
    /*购物车*/
        data = {ecom_cart : {prod : goods}};
    /**/

    rtTag.data = data;
    window.mllSpreadData = ['_trackRTEvent',rtTag];
})(window);
</script>
<script src="js/ana.min.js"></script>
<script>window._ana && _ana.push( ['trackView'] );</script>
<script>window._gaq=window._gaq||[];$(window).on("load",function(){window._gaq=window._gaq||[];window.MLLgaq=window.MLLgaq||[];for(var a=0;a<MLLgaq.length;a++){_gaq.push(MLLgaq[a]);}_gaq.push(["_setAccount","UA-10173353-1"]);_gaq.push(["_setDomainName","meilele.com"]);_gaq.push(["_trackPageview"]);var d=document.createElement("script"),b=new Date();d.type="text/javascript";d.async=true;d.defer=true;d.src=$.__IMG+"/zximages/js/dc.js?"+b.getFullYear()+(b.getMonth()+1)+(b.getDate()<10?"0"+b.getDate():b.getDate());var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(d,c);});function parseGaData(){_gaq.push([arguments[0],arguments[1],arguments[2],arguments[3]]);}function gaSetActiveUser(b,a){if(!/isActiveUser=1/.test(document.cookie)&&!/ECSCP_ID=/.test(document.cookie)&&!/ECS_MLL_SE=/.test(document.cookie)){_gaq.push(["_trackEvent","ActiveUser",b+"",a+""]);if(window.$&&$.cookie){jQuery.cookie("isActiveUser","1",{domain:location.host,path:"/"});}}}_LOAD_SCRIPT_("http://hm.baidu.com/h.js?d91942b1e6dd95baed4560c0c6d8071b");window.bd_cpro_rtid="rHnLnHT";_LOAD_SCRIPT_("http://cpro.baidu.com/cpro/ui/rt.js");_LOAD_SCRIPT_("http://tajs.qq.com/stats?sId=11450600");_LOAD_SCRIPT_("http://tajs.qq.com/gdt.php?sId=23384945");_LOAD_SCRIPT_("http://tajs.qq.com/gdt.php?sId=21253825");_LOAD_SCRIPT_("http://tajs.qq.com/gdt.php?sId=26418742");_LOAD_SCRIPT_("http://tajs.qq.com/gdt.php?sId=43311811");window.goSpread=function(b){window._hmt=window._hmt||[];b=b||window.mllSpreadData||["_trackRTEvent",{data:{}}];var a=["_setAccount","d91942b1e6dd95baed4560c0c6d8071b"];window._hmt.push(a);window._hmt.push(b);return window._hmt;};_LOAD_SCRIPT_("http://hm.baidu.com/hm.js?d91942b1e6dd95baed4560c0c6d8071b");if(!window.notGoSpread){goSpread();}window.gdt_tracker=window.gdt_tracker||[];window.goGdt=function(a){gdt_tracker.push(["set_source_id","3"]);for(var b=0;b<a.length;b++){gdt_tracker.push(a[b]);}gdt_tracker.push(["send"]);_LOAD_SCRIPT_("http://qzs.qq.com/qzone/biz/res/gt.js");};(function(a){if(a.notJuXiao){return false;}a._mvq=a._mvq||[];_mvq.push(["$setAccount","m-22687-1"]);_mvq.push(["$logConversion"]);_LOAD_SCRIPT_("https:"==document.location.protocol?"https://static-ssl.mediav.com/mvl.js":"http://static.mediav.com/mvl.js");})(window);if(window.jQuery){jQuery(window).on("load",function(){jQuery.ajax({url:"http://cn-tags.vizury.com/analyze/pixel.php?account_id=VIZVRM1409",dataType:"script",async:true,cache:true,success:function(){window.pixel&&pixel.parse();}});});}(function(){if(Math.random()>0.1||!window.jQuery){return;}$(window).on("load",function(){var g;var c=function(i){var j=$(i);var h=j.parent("a");if(!h&&h.length!=1){return false;}var k=/\/category-.*\/goods-(\d+)\.html/.exec(h.prop("href"));if(k&&k[1]){i.__goodsId=k[1];i.__offsetTop=i._offsetTop||j.offset().top;return k[1];}else{return false;}};var d=function(h){h.__isSendGa=true;window._mllga&&window._mllga({utmac:"UA-53663717-1",utme:"5("+h.__goodsId+"*"+(h.getAttribute("data-src")||h.src)+")"});};var b=document.images;var f=[];for(var a=0,e=b.length;a<e;a++){if(c(b[a])){f.push(b[a]);}}scrollResponse=function(){if(g){clearTimeout(g);}g=setTimeout(function(){var i=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;for(var h in f){if(!f[h].__isSendGa&&i+document.documentElement.clientHeight>f[h].__offsetTop&&i<f[h].__offsetTop+(f[h].height||f[h].cilentHeight)){d(f[h]);}}},300);};scrollResponse();$(window).on("scroll",scrollResponse);});})();$(window).on("load",function(){if(!window._mllga){return;}var c=/thg=(.+)&adg=(.+)&adn=(.+)&ado=(.+)&adc=(\d+)/i;var a=function(e){var h=c.exec(e);if(h&&h.length==6){for(var g=1;g<=5;g++){if(h[g]){try{h[g]=decodeURIComponent(h[g].replace("*",""));}catch(f){}}}h.push(window.jQuery&&window.jQuery.cookie("region_name"));return h;}return false;};var d=function(e,f){if(!f){return;}var g="";if(window.getCookie&&getCookie("MLL_CID")){g="8(CID)9("+getCookie("MLL_CID")+")11(2)";}_mllga({utmac:"UA-52467404-2",utmt:"event",utme:"5("+e+"_"+f[1]+"*"+e+"_"+f[2]+"*"+e+"_"+f[3]+"_"+f[4]+"_"+f[6]+")"+g});};if(c.test(location.href)){var b=a(location.href);d("ad_click",b);window._ana&&window._ana.push(["trackEvent","ad_click",b[1],b[2],b[3],b[4],b[6]]);}setTimeout(function(){var j=document.links;var h=[],f;for(var e=0,l=j.length;e<l;e++){f=j[e].getAttribute("href");if(j[e]&&f&&c.test(f)){h.push(a(f));}}for(var g=0;g<h.length;g++){if(h[g]&&Math.random()<0.1){d("ad_show",h[g]);}}},5000);});$(window).on("load",function(){var c=location.search;if(c){c=c.replace("?","").split("&");for(var b=0;b<c.length;b++){if(c[b].indexOf("from=MT")===0){var a=new Image;a.src="/solr_api/mss/message/statistic.do?fromUrl="+encodeURIComponent(location.href);return;}}}});(function(){var a=window.google_tag_params||{ecomm_pagetype:"other"};var c=new Image();var d=[];for(var b in a){d.push("data."+b+"="+encodeURIComponent(a[b]));}var e="//googleads.g.doubleclick.net/pagead/viewthroughconversion/992307345/?value=0&label=_2h2CK-jsgQQkdGV2QM&guid=ON&script=0&"+d.join("&");if(window.jQuery){jQuery(window).on("load",function(){c.src=e;});}else{window.onload=function(){c.src=e;};}})();window.criteo_q=window.criteo_q||[];window.goCriteo=function(c){if(criteo_q.length==0){criteo_q=[{event:"viewHome"}];}var b=window.getCookie&&window.getCookie("ECS[email]");var a=[{event:"setAccount",account:17380},{event:"setCustomerId",id:b||""},{event:"setSiteType",type:"d"}];Array.prototype.push.apply(criteo_q,a);_LOAD_SCRIPT_("http://static.criteo.net/js/ld/ld.js",c);};if(!window.notGoCriteo){goCriteo();}
/*leihao:2016-03-24 16:09:27*/</script>
<script type="text/javascript">
var _dxt = _dxt || [];
_dxt.push(["_setUserId", $.cookie('MLL_CID')]);
(function() {
	var hm = document.createElement("script");
	hm.src = "//datax.baidu.com/x.js?si=&dm=meilele.com";
	var s = document.getElementsByTagName("script")[0];
	s.parentNode.insertBefore(hm, s);
})();
</script><script>

//腾讯动态创意，放在ga.lbi之后
;(function(window){
    var data = [];
    /**/
    /**/
        /**/
        data.push(["add_action","ADD_TO_CART",'25841','http://' + window.location.host + '/category-chuangtougui/goods-25841.html','279','床头柜','212','1']);
        /**/
    /**/
    /**/
    window.goGdt && window.goGdt(data);
})(window);
</script>

<script>
    $(document).ready(function(){
        _gift.css();
        _gift.init();
    })
    
    var _gift = function () {
        var globalgiftData = {},total_num = 0;
        
        var getGiftData = function(){
            return globalgiftData;
        }
        var setGiftData = function(obj){
            globalgiftData = obj
        }
        var getNum = function(){
            return total_num
        }
        var setNum = function(num){
            total_num = num;
        }
        var totalNum = function(){
            var target = $('tr[data-goods_num]'),num = 0;
            for(var i=0;i<target.length;i++){
                num += +$(target[i]).attr('data-goods_num')
            }
            setNum(num);
        }
        var cssInit = function(){
            var css = [];
            css.push('.l .label{height: 19px;line-height: 19px;padding: 1px 3px;_padding-top:2px;background: #c9033b;color: #fff;margin-right: 6px;}');
            css.push('.l .rose{margin-left: 6px;color: #c9033b;')
            $.insertStyle(css.join(''));
            style();
        }
        var init = function(){
            totalNum();
            var id_str = "25841",rec_str= "24427651",target = rec_str.split(',')
            var num_str='';
            for(var i=0;i<target.length;i++){
                var n = $('tr[data-rec_id="'+target[i]+'"]').find('.m_goods_num').attr('data-num');
                if($('input[data-rec_id="'+target[i]+'"]').length){
                    num_str +=$('input[data-rec_id="'+target[i]+'"]').val()+","
                } else {
                    num_str += n +","
                }
            }
            num_str = num_str.substring(0,num_str.length-1)

            //商品id集合
            var recs_id = rec_str.split(',');
            if(id_str&&rec_str&&num_str){
                $.ajax({
                    url: '/add_cart/?step=queryMainGoodsToGiftsWithStock',
                    data: {"goodsId":id_str,"goodsNumber":num_str,"goods_rec_id":rec_str},
                    type: 'post',
                    dataType: 'json',
                    async: false,
                    success: function(data) {
                        setGiftData(data);
                        if(data.error == 0){
                            
                            for(var i=0;i<recs_id.length;i++){
                                var g_rec_id = recs_id[i],target = '#JS_cart_tr_' + g_rec_id;
                                var gift_kind_number = $('#JS_cart_tr_'+g_rec_id).attr("data-gift_kind");
                                
                                if(data.result[g_rec_id]&&data.result[g_rec_id].hasGifts&&data.result[g_rec_id].giftsOnSaleState != 2){
                                    var html = '';
                                    html += '<tr class="JS_cart_tr_'+ g_rec_id +'"><td></td><td class="l" colspan="9" style="text-align:left;padding:0"><div class="zp"><a id="goods_'+ data.result[g_rec_id].goodsId +'_'+ g_rec_id +'" data-goods_num="'+ data.result[g_rec_id].goodsNum +'" style="margin-left:0;"  class="rose" href="javascript:;" data-num="'+ data.result[g_rec_id].giftTypeNum +'">选择赠品&nbsp;&gt;&nbsp;&nbsp;&nbsp;<span id="JS_gift_tip_'+ g_rec_id +'" style="font-weight:bold;"></span></a><span class="JS_gift_zp_'+ g_rec_id +'" style="color:#F60;font-size:12px">赠品已送完</span></div></td></tr>';
                                    
                                    if($('.JS_cart_tr_'+ g_rec_id).length){
                                        $('.JS_cart_tr_'+ g_rec_id).remove()
                                    }   
                                 
                                    $(target).after(html);
                                    
                                    var gift_kind_checknumer = $('.mgift_id_'+g_rec_id).length;
                                        
                                    if(gift_kind_checknumer == 0) {
                                        $("#JS_gift_tip_"+g_rec_id).text('您还未选择！')
                                    }else {
                                        $("#JS_gift_tip_"+g_rec_id).text('')
                                    }

                                    //只有赠品中至少有一个不为虚拟商品都不显示赠品已送完
                                    var aR = [];
                                    if( data.result[g_rec_id]['gifts'] ){
                                        for( var j = 0,jj = data.result[g_rec_id]['gifts'].length;j < jj; j++ ){
                                            var gifsData = data.result[g_rec_id]['gifts'][j]['gift_attribute'];
                                            if( gifsData != 4 ){
                                                aR.push(g_rec_id);
                                            }
                                        }
                                    }
                                    function unique(arr) {
                                        var result = [], hash = {};
                                        for (var i = 0, elem; (elem = arr[i]) != null; i++) {
                                            if (!hash[elem]) {
                                                result.push(elem);
                                                hash[elem] = true;
                                            }
                                        }
                                        return result;
                                    }
                                    var aRnew = unique(aR);
                                    for(var k = 0,kk = aRnew.length; k < kk; k++ ){
                                        jQuery('.JS_gift_zp_'+aRnew[k]).addClass('none');
                                    }
                                }

                            }
                            //監聽選擇按鈕事件
                            $('.rose').unbind().on('click',function(){
                                var targetId = $(this).closest('tr').attr('class');

                                var _val = $('#'+targetId).find('.l').siblings('.m_goods_num').find('input'),_id = $(this)[0].id.split('_')[1],_rec = $(this)[0].id.split('_')[2],_count = $(this).attr('data-num');
                                
                                if(_val.length) {
                                    _val = _val.val();
                                } else {
                                    _val = $(this).closest('.l').siblings('.m_goods_num').attr('data-num')
                                }
                                _alert(_id,_rec,_val,_count);
                            })

                        } else if(data.error==1){
                            if(data.msg){
                                alert(data.msg);
                            }
                        }
                    }
                });
            }
        }
        
        var html = function(){
            var dom = '';
            dom += '<div class="g_t_bar clearfix"><span class="g_title">选择赠品</span><span id="gift_tip" style="font-size:12px;line-height:24px;margin-left:6px;float:left;"></span><span class="g_close">x</span></div>';
            dom += '<ul class="g_content"></ul>';
            dom += '<div class="g_btn"><a id="m_g_submit" href="javascript:;">确定</a><span class="g_warn"></span></div>';
            return dom
        };
        
        var ajaxInit = function(id_str,rec_str,num_str,count) {
            var dom = '';
            $.ajax({
                url: '/add_cart/?step=queryMainGoodsToGiftsWithStock',
                data: {"goodsId":id_str,"goodsNumber":num_str,"goods_rec_id":rec_str},
                type: 'post',
                dataType: 'json',
                async: false,
                success: function(data) {

                    if(data&&data.result&&data.result[rec_str].gifts){
                        for(var i=0;i<data.result[rec_str].gifts.length;i++){
                            var gn = data.result[rec_str].gifts[i].giftName;
                            if(gn.length > 17){
                                gn = gn.substring(0,16)+'...'
                            }

                            var gifsData = data.result[rec_str].gifts[i];

                            //判断赠品中是否有虚拟商品
                            if( gifsData['gift_attribute'] == 4 ){ //等于4是虚拟商品

                                dom += '<li class="g_list clearfix"><input disabled="true" class="g_cb" type="checkbox" id="gr_'+ data.result[rec_str].gifts[i].giftId +'" /><a href="'+ data.result[rec_str].gifts[i].giftUrl +'"><img class="g_img" width="70" height="45" src="picture/1a6a7cb0136a4b309f2f647cfd91ff74.gif'+ data.result[rec_str].gifts[i].giftThumb1 +'"></a><span class="g_c"><a title="'+ data.result[rec_str].gifts[i].giftName +'" href="'+ data.result[rec_str].gifts[i].giftUrl +'">'+ gn +'</a></span><span class="g_n">' + data.result[rec_str].gifts[i].giftNumber+'</span><p style="margin:50px 0 0 37px;color:#F60">赠品已送完</p></li>';
                            }else{
                                var flag = data.result[rec_str].gifts[i].checked?'checked':''
                                dom += '<li class="g_list clearfix"><input '+ flag +' class="g_cb" type="checkbox" id="gr_'+ data.result[rec_str].gifts[i].giftId +'" /><a href="'+ data.result[rec_str].gifts[i].giftUrl +'"><img class="g_img" width="70" height="45" src="picture/1a6a7cb0136a4b309f2f647cfd91ff74.gif'+ data.result[rec_str].gifts[i].giftThumb1 +'"></a><span class="g_c"><a title="'+ data.result[rec_str].gifts[i].giftName +'" href="'+ data.result[rec_str].gifts[i].giftUrl +'">'+ gn +'</a></span><span class="g_n">' + data.result[rec_str].gifts[i].giftNumber+'</span></li>';
                            }
                        }
                        $('.g_content').empty().html(dom);
                        $('#gift_tip').text('赠品最多赠送'+ count +'种，实际赠送数量根据库存而定')
                        checkInit(count)
                    }
                }
            });
        }
        var style = function(){
            var g_css = [];
            g_css.push('.gift_m .in{border:3px solid #bbb !important}');
            g_css.push('.gift_m .htmls{padding: 0 !important}');
            g_css.push('.gift_m .g_t_bar{background-color:#f1f1f1;padding:10px 8px;font-size:16px;border-bottom: 1px solid #e6e6e6}');
            g_css.push('.gift_m .g_title{float:left;font-family:"微软雅黑"}');
            g_css.push('.gift_m .g_close{float:right;font-weight:bold;color:#bbb;font-family:"黑体";cursor:pointer}');
            g_css.push('.gift_m .g_content{height:270px;overflow:auto}');
            g_css.push('.gift_m .g_list{padding: 10px 25px 8px 0;border-bottom: 1px solid #e6e6e6}');
            g_css.push('.gift_m .g_cb,.gift_m .g_img,.gift_m .g_c{float:left;margin-left:10px}');
            g_css.push('.gift_m .g_cb{margin-top:15px}');
            g_css.push('.gift_m .g_n{float:right}');
            g_css.push('.gift_m .g_c,.gift_m .g_n{line-height:45px}');
            g_css.push('.gift_m .g_btn{text-align:left;padding: 14px 8px;}');
            g_css.push('.gift_m .g_btn a {margin:0 10px;padding: 4px 12px;border:1px solid #bbb}');
            g_css.push('.gift_m .g_btn a:hover {color: #333 !important;text-decoration:none}')
            g_css.push('.gift_m .g_btn a.g_hover:hover {color: #bbb !important}')
            g_css.push('.gift_m .g_btn .g_warn {color: #c9033b}')
            g_css.push('.gift_tr td {padding: 4px}')
            $.insertStyle( g_css.join('') );
        };
        var _alert = function(id,rec,num,count){
            var lbi;
            $.lightBox(html(), null , null , null , null , true , 'gift_m');
            lbi = $.lightBoxId;
            ajaxInit(id,rec,num,count);
            closeInit(lbi);
            
            $('#m_g_submit').on('click',function(){
                if($(this).hasClass('g_hover')){
                    return;
                }
                var list = $('.g_cb:checked');
                var giftId ='';
                for(var i= 0;i<list.length;i++){
                    giftId += list[i].id.split('_')[1]+','
                }
                giftId = giftId.substring(0,giftId.length-1)
                
                $.ajax({
                    url: '/add_cart/?step=changeCartGifts',
                    data: {"goodsId":id,"goodsNumber":num,"giftId":giftId,"goods_rec_id":rec},
                    type: 'post',
                    dataType: 'json',
                    success: function(data) {
                        if(data.error == 0){

                            gift_tr(data.result[rec].gifts,rec,id);
                            var gift_kind_checknumer = $('.mgift_id_'+rec).length;                            
                            
                            if(gift_kind_checknumer == 0) {
                                $("#JS_gift_tip_"+rec).text('您还未选择！')
                            }else {
                                $("#JS_gift_tip_"+rec).text('')
                            }
                            globalgiftData = data;
                            refreshPrice(rec);
                            $.closeLightBox(lbi)
                        } else if(data.error == 1){
                            if(data.msg){
                                alert(data.msg)
                            }
                        }
                    }
                }); 
            })
        };
        
        var gift_tr = function(arr,rec){
            var dom = '';
            for(var i=0;i<arr.length;i++){
                var zhekou = arr[i].giftPrice * arr[i].giftNumber;
                
                dom += '<tr class="gift_tr mgift_id_'+ rec +'" giftId="'+arr[i].giftId+'"><td style="padding: 4px 0"></td><td colspan="9" style="padding:0 0 8px;line-height:1.5;" class="l"><a href="'+ arr[i].giftUrl +'" target="_blank"><span class="discount" style="background:#c9033b;margin:0 6px 0 0;padding:1 6px;float:left">买赠</span><span style="color:#888;max-width:480px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float:left;margin-right:4px">'+arr[i].giftName+'</span><span class="gifts_num" style="float:left;color:#888">x'+arr[i].giftNumber+'</span></a></td></tr>'
            }
            var list = ".mgift_id_"+rec;
            $(list).remove();
            var parentDom = 'tr[data-rec_id="'+ rec +'"]';
            $(parentDom).next().after(dom);
        };
        
        var checkInit = function(num){
            $('.g_cb').unbind().on('click',function(){
                var len = $('.g_cb:checked').length
                if(len>num){
                    $('.g_warn').text('选择的赠品种类超过可选数量')
                    $('.gift_m .g_btn a').css({'background-color':'#eee','color':'#bbb','cursor':'default'})
                    $('.gift_m .g_btn a').addClass('g_hover');
                } else {
                    $('.g_warn').text('');
                    $('.gift_m .g_btn a').css({'background-color':'#fff','color':'#333','cursor':'pointer'})
                    $('.gift_m .g_btn a').removeClass('g_hover');
                }
            })
        };
        var closeInit = function(id){
            $('.g_close').unbind().on('click',function(){
                $.closeLightBox(id)
            })
        };
        return {
            css: cssInit,
            init: init,
            alert:_alert,
            close:close,
            tr:gift_tr,
            getGiftData:getGiftData,
            setGiftData:setGiftData,
            getNum:getNum,
            setNum:setNum
        }
        
    }()
</script>
</body>
</html>

<!--
mazengliang*224723:2016-08-15 18:26:23
-->